I am new GAE and I need some help. Is it possible to query for entities with a property value null using GAE JDO query?
I want something like "Get me all the Files that don't have a parent" In regular relational DBs, it can be queried some thing like this: "select * from File where parentKey is null" I have a class something like this: public class File { @Persistent @PrimaryKey private Key id; @Persistent String name; @Persistent private Key parentKey; } When I am querying for Files that have null parentKey, query returns all Files including those with non-null parentKey value. Is this possible to do with GAE? Thanks! On Dec 22, 1:33 pm, dantuluri <pdantul...@gmail.com> wrote: > Hi, > > I have an entity that has the following structure: > > File which has Key as primary key and ParentKey that refers to > another File which is parent of this File. Example data for this > structure looks like this: > > Key: File(2) > Name: Inbox > parentKey: File(1) > > It is possible that File may not have a parentKey. > > I want to query the DataStore for Files that don't have parent file > (parentKey == null). But when I am querying with parentKey == null, I > am still getting all Files including those with parentsKeys. How can > we do this with JDO query with App Store? I must be missing something > basic here. > > Similarly I would like to get the child folders of a given folder > (parentKey == File(1)). > > Any help would be appreciated! > > Thanks -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.