开发者

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

开发者 https://www.devze.com 2023-04-04 08:07 出处:网络
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(claz

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

精彩评论

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

关注公众号