选择某个“列”对于 JDO 实体
我在appengine数据存储区中有一个名为DataBase的实体,它包含一些属性或列或者在JDO中命名的任何内容,我只想从该实体中选择一些列,所以我使用这样的选择语句,
String query = "select from " + DataBase.class.getName()+" where id == '"+user+"'";
List<DataBase> greetings = (List<DataBase>) pm.newQuery(query).execute();
所以我选择该实体中的所有内容它的 id=user...fine.I 实际上想从该列表中获取某些列并将其放入单独的列表中,这样我就可以对其执行一些功能有人可以帮忙吗???
I have a entity in the appengine datastore called DataBase which contains some attributes or columns or what ever it is named in JDO,I want to select only some columns from that entity so i use select statment like that
String query = "select from " + DataBase.class.getName()+" where id == '"+user+"'";
List<DataBase> greetings = (List<DataBase>) pm.newQuery(query).execute();
so i select all things in that entity its id=user...fine.I actually want to get certain column from that list and put it in a separate list so i can do some functionality on it can somebody help???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在 App Engine 中选择单个列。实体存储为序列化协议缓冲区,因此它们作为一个单元而不是单独检索。
You can't select individual columns in App Engine. Entities are stored as serialized protocol buffers, so they're retrieved as a unit, not individually.