title: GAE - JDO Query fails while using Enum field and 'contains' operator to filter data
body: <p>I am using an Enum field in Datastore entity class.</p>
  
  <pre><code>public enum MyEnum{
    A(0x9001L),
    B(0x9002L),
    C(0x9003L),
    D(0x9004L),
    private long value;
    private MyEnum(long value) {
      this.value = value;
    }
  };
  </code></pre>
  
  <p>ENTITY</p>
  
  <pre><code>@PersistenceCapable
  public class Log implements Serializable, Comparable&lt;Object&gt;, Cacheable {
  
      @PrimaryKey
      @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
      private Long id;
  
      @Persistent
      private MyEnum myEnumVariable;  
  }        
  </code></pre>
  
  <p>When I make a query by filtering only one Enum type </p>
  
  <pre><code>declareParams.append(",Long myEnumVariable");
  filterQuery.append(" this.myEnumVariable == myEnumVariable");
  </code></pre>
  
  <p>.. then the code works fine.</p>
  
  <p>But when I make a query to filter multiple Enums </p>
  
  <pre><code>declareParams.append(",List myEnumList");
  filterQuery.append(" myEnumList.contains(this.myEnumVariable )");
  </code></pre>
  
  <p>I get an error saying - </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: MyEnum : com.xxx.xxx.MyEnum  is
    not a supported property type.    at
    com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
      at
    com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:149)
      at
    com.google.appengine.api.datastore.Query$FilterPredicate.(Query.java:619)
      at com.google.appengine.api.datastore.Query.addFilter(Query.java:261)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.addLeftPrimaryExpression(DatastoreQuery.java:1343)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:1070)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:1054)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.addExpression(DatastoreQuery.java:1053)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.addFilters(DatastoreQuery.java:1031)
      at
    org.datanucleus.store.appengine.query.DatastoreQuery.performExecute(DatastoreQuery.java:238)
      at
    org.datanucleus.store.appengine.query.JDOQLQuery.performExecute(JDOQLQuery.java:92)
      at org.datanucleus.store.query.Query.executeQuery(Query.java:1489)
      at org.datanucleus.store.query.Query.executeWithMap(Query.java:1398)
      at org.datanucleus.jdo.JDOQuery.executeWithMap(JDOQuery.java:334)</p>
  </blockquote>
  
  <p>NOTE: the object 'myEnumList' is a collection of 'MyEnum' type elements.
  When I use a list of 'Long' type elements, I don't see the error, but empty results are returned</p>