title: Loading a collection of Enums with Google app engine datastore
body: <p>I am using the Goole app engine datastore with Java and trying to load an Object with a List of Enums. Every time I load the object the List is null. The object is</p>
  
  <pre><code>@PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class ObjectToSave {
  
      @PrimaryKey
      @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
      private Long id;
  
      @Persistent
      private List&lt;AnEnum&gt; anEnumList;
  
      //public getters and setters
  }
  </code></pre>
  
  <p>The enum is simple</p>
  
  <pre><code>public enum AnEnum {
      VALUE_1,
      VALUE_2;
  }
  </code></pre>
  
  <p>The code to save it is</p>
  
  <pre><code>ObjectToSave objectToSave = new ObjectToSave();
  List&lt;AnEnum&gt; anEnumList = new ArrayList&lt;AnEnum&gt;();
  anEnumList.add(AnEnum.VALUE_1);
  objectToSave.setAnEnumList(anEnumList);
  PersistenceManager pm = pmfInstance.getPersistenceManager();
  try {
      pm.makePersistent(objectToSave);
  } finally {
      pm.close();
  }
  </code></pre>
  
  <p>The code to load it is</p>
  
  <pre><code>PersistenceManager pm = pmfInstance.getPersistenceManager();
  try {
      Key key = KeyFactory.createKey(ObjectToSave.class.getSimpleName(), id);
      ObjectToSave objectToSave = pm.getObjectById(ObjectToSave.class, key);
  } finally {
      pm.close();
  }
  </code></pre>
  
  <p>I can view the data in the datastore using <a href="http://localhost:8080/_ah/admin" rel="nofollow noreferrer">http://localhost:8080/_ah/admin</a> and can see my List has been saved but it is not there when the object is loaded.</p>
  
  <p>I created my project with the Eclipse plugin and haven't made any changes to the datastore settings as far as I know. So why id my Enum list null?</p>