Java 谷歌应用引擎数据库模型
我需要一个GAE中的简单应用程序: 我有以下用户:Java 谷歌应用引擎数据库模型,java,google-app-engine,google-cloud-datastore,Java,Google App Engine,Google Cloud Datastore,我需要一个GAE中的简单应用程序: 我有以下用户: public User { private @Id Long id; private String name; } 和信息 private Message { private @Id Long id; private Key sender; private Key reciever; private Date sendDate; } 问题是: 我需要获取给定用户发送和接收的按日期排序的所有消息
public User {
private @Id Long id;
private String name;
}
和信息
private Message {
private @Id Long id;
private Key sender;
private Key reciever;
private Date sendDate;
}
问题是:
我需要获取给定用户发送和接收的按日期排序的所有消息
我想我选错型号了
你能给我一些建议吗
谢谢 只需将发送方和接收方更改为字符串类型,并在测试中确保执行查询(这将自动将它们设置为索引)。我将尝试以下操作:
SELECT * FROM Message WHERE sender = 'givenUserID' OR reciever = 'givenUserID' ORDER BY 'sendDate'
看看()吧,这是Brett Slatkin在Google I/O上发表的一篇精彩演讲。他解决了构建可伸缩消息服务的问题。如果我没有错,它就不能在BigTable查询中使用“或”。