java - Objectify can't find entity that appears to exist -


i'm using objectify 5.1.1 on google app engine. have defined objectify entity called insight , tried query boolean property called downloaded. however, objectify can't find entity.

here's how i'm trying query:

query<insight> insightquerytemplate = ofy().load().type(insight.class).                 filter("downloaded", false).first().safe(); 

here's stripped down class definition insight:

@com.googlecode.objectify.annotation.entity public class insight {     @com.googlecode.objectify.annotation.id      public long id;      public boolean downloaded = false;      public insight () { }  } 

when in development server's datastore can see entity exist downloaded property says "false (unindexed)" instead of "false".

i'm pretty sure used work objectify 3.1 doing wrong?

i think tag @com.googlecode.objectify.annotation.index needs annotated on class this:

@com.googlecode.objectify.annotation.entity public class insight {     @com.googlecode.objectify.annotation.id      public long id;      @com.googlecode.objectify.annotation.index  // *** missing ***     public boolean downloaded = false;      public insight () { }  } 

according https://cloud.google.com/appengine/docs/java/datastore/indexes#java_unindexed_properties, properties either set setproperty() or setunindexedproperty(). current documentation objectify says properties set unindexed default.

so annotated class @com.googlecode.objectify.annotation.index , problem fixed.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -