Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1eu2QCj
via LifeLong Community
SELECTING CHILD ENTITIES WITH GQL QUERIES
http://ift.tt/1eu2RX6
A one-to-many bidirectional relationship is similar to a one-to-one, with a field on the parent class using the annotation @Persistent(mappedBy= "..."), where the value is the name of the field on the child class:
SELECT * FROM Model where _key_ = KEY('Make', 'canon', 'Model', 'canon eos 5d')
Key makeKey = KeyFactory.createKey(Make.class.getSimpleName(), makeName);
// Can create the Model key by specifying parent key...
Key modelKey = KeyFactory.createKey(makeKey, Model.class.getSimpleName(), name);
// Bam! Get the child entity in a single query
Model model = pm.getObjectById(Model.class, modelKey);
http://ift.tt/1eu2RX6
A one-to-many bidirectional relationship is similar to a one-to-one, with a field on the parent class using the annotation @Persistent(mappedBy= "..."), where the value is the name of the field on the child class:
SELECT * FROM Model where _key_ = KEY('Make', 'canon', 'Model', 'canon eos 5d')
Key makeKey = KeyFactory.createKey(Make.class.getSimpleName(), makeName);
// Can create the Model key by specifying parent key...
Key modelKey = KeyFactory.createKey(makeKey, Model.class.getSimpleName(), name);
// Bam! Get the child entity in a single query
Model model = pm.getObjectById(Model.class, modelKey);
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1eu2QCj
via LifeLong Community
No comments:
Post a Comment