开发者

JDO Google App Engine: How do I persist then query List of custom typed object that is a child of a custom typed parent?

开发者 https://www.devze.com 2023-03-16 04:33 出处:网络
I\'m using Objectify to try and persist some custom type Objects and then retrieve them using a query.

I'm using Objectify to try and persist some custom type Objects and then retrieve them using a query.

How would I persist and then query just the Command objects?

Here are the objects:

public class Command {
    @Id private Key key;
  开发者_StackOverflow社区  public ArrayList<Section> sections;
}

class Section {
    @Id private Key key;
    public ArrayList<Phrase> phrases;
}

class Phrase {
    public String phrase;
    public String output;
    @Id private Key key;
}


Objectify requires that, there must be an @Id field (String, Long, or long) in your objects (POJO) in order to persist the object into datastore. check out the link below for detailed info regarding persisting and querying

http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#Create_Your_Entity_Classes

0

精彩评论

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