简体   繁体   中英

Best practice to store relations in Java GAE with datastore

I wonder what is best practice to store relations in GAE with datastore.

If I have User and UserItem. How should I store reference to User inside UserItem?

Should I store:

  • hashed key value (eg: ag1taWNlM2hlZGdlaG9ncg8LEglMZXZlbFVzZXIYSAw )
  • unhashed key value (eg: User("1") )
  • any other suggestion?

在Java中,您将使用Key属性存储对另一个数据存储对象的引用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM