I have a very simple app engine program. I'm following all of the JDO
instructions and have a class like this:

@PersistenceCapable
public class ExampleUser {
    @PrimaryKey
    @Persistent
    private Long id;

    @Persistent
    private String name;

    public ExampleUser(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public String toString() { return "["+name+":"+id+"]"; }

    public Long id() { return id; }
    public String name() { return name; }
}

I programmatically inserted one item for this and waiting for the
datastore statistics to exist before pulling down the config via
"create_bulkloader_config". This is the yaml property_map:

 50 - kind: ExampleUser
 51   connector: csv # TODO: Choose a connector here: csv, simplexml,
etc...
 52   connector_options:
 53     # TODO: Add connector options here--these are specific to each
connector.
 54   property_map:
 55     - property: __key__
 56       external_name: key
 57       export_transform: transform.key_id_or_name_as_string
 58
 59     - property: name
 60       external_name: name
 61       # Type: String Stats: 11 properties of this type in this
kind.
 62

Here's what a sample download looks like (with the names intentionally
truncated):
  1 name,key
  2 Nef,1
  3 clu,2
  4 Guy,1
  5 edg,2

Now in this example lines 2 & 3 were inserted programmatically
specifying the id as a Long. Where as lines 4 & 5 were inserted with
the bulk uploader.

When I re-upload this file I lose users on lines 4 & 5 and users on 2
& 3 are there twice. This is the view from the datastore admin panel:
id=1     Nef
id=2     clu
name=1   Nef
name=2   clu

I really want to use the Long id's as ID's in other JDO objects, but
don't think I will be able to if I can't upload with explicit Id's. Is
there any way I can modify the yaml file to insert with id= and not
name=?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to