开发者

How can I get the ID/Name of an entry using datastore

When I look under http://localhost:8888/_ah/admin/ I can see that every entry in datastore has an ID/Name field. I also know that I can get objects with this id using persistenceManager.getObject(clazz, id);

Is i开发者_运维百科t possible to mark some attribute to use the value of this field? So that when requestion object A I could easily access it's ID/Name?

Note: I am not using the Key object because it gave me trouble using the same object in client and server.


I had to add @Extension to my ID attribute (key="gae.pk-id")

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜