title: AppEngine datastore query for all entities that have a given property (Java)
body: <p>I am trying to figure out an elegant way to query all of the entities in an AppEngine datastore that have a certain property.  Since entities that lack a property aren't included in an index, basically what I want to do is to retrieve the index for a given property.  I'm sure it's possible to do something like:</p>
  
  <pre><code>Filter bigger = new FilterPredicate(PROPERTY,
                    FilterOperator.GREATER_THAN_OR_EQUAL,
                    0);
  
  Filter smaller = new FilterPredicate(PROPERTY,
                    FilterOperator.LESS_THAN_OR_EQUAL,
                    0);
  
  Filter present = CompositeFilterOperator.or(bigger, smaller);
  
  Query q = new Query(KIND).setFilter(present);
  </code></pre>
  
  <p>but it doesn't look like a very elegant (or efficient) solution.  Does anyone have a better idea?</p>