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
精彩评论