According to the documentation on
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys
it should be possible to retrieve an entity using a different key type
than the key field in the class.

Assuming the following entity having a key (encoded string) and a
keyId like

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk",
value="true")
    private String encodedKey;

    @Persistent
    @Extension(vendorName="datanucleus", key="gae.pk-id",
value="true")
    private Long keyId;

it should be possible to retrieve the entity by both

pm.getObjectById(myEntity.class, encodedKey);
and
pm.getObjectById(myEntity.class, keyId);

do I understand that correctly? - (since it does not work out for my
code)

thanks,
andr

--

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


Reply via email to