Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 403341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:12:28+00:00 2026-05-12T17:12:28+00:00

I am using the Goole app engine datastore with Java and trying to load

  • 0

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

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class ObjectToSave {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

    @Persistent
    private List<AnEnum> anEnumList;

    //public getters and setters
}

The enum is simple

public enum AnEnum {
    VALUE_1,
    VALUE_2;
}

The code to save it is

ObjectToSave objectToSave = new ObjectToSave();
List<AnEnum> anEnumList = new ArrayList<AnEnum>();
anEnumList.add(AnEnum.VALUE_1);
objectToSave.setAnEnumList(anEnumList);
PersistenceManager pm = pmfInstance.getPersistenceManager();
try {
    pm.makePersistent(objectToSave);
} finally {
    pm.close();
}

The code to load it is

PersistenceManager pm = pmfInstance.getPersistenceManager();
try {
    Key key = KeyFactory.createKey(ObjectToSave.class.getSimpleName(), id);
    ObjectToSave objectToSave = pm.getObjectById(ObjectToSave.class, key);
} finally {
    pm.close();
}

I can view the data in the datastore using http://localhost:8080/_ah/admin and can see my List has been saved but it is not there when the object is loaded.

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:12:29+00:00Added an answer on May 12, 2026 at 5:12 pm

    Yes but your List field is not in the default fetch group at loading so hence is not loaded.
    Read JDO Fetch Groups. You could add it to the DFG, or enable a custom fetch group, or just “touch” the field before closing the PM.

    –Andy (DataNucleus)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Google App Engine with the Datastore interface. Whenever I'm trying to
I am trying to build a simple app using google app engine, with java
Since there is no way to join tables using Google App Engine datastore, I
I'm using nested entity groups in an HRD google app engine datastore. A <
I'm building a simple play against a random opponent back-end using Goole App Engine.
Using Google App Engine, I am trying to urlfetch a gzip file from a
I'm using the low-level API in Google App Engine for Java and want to
I am developing a Java application using Google App Engine that depends on a
so I am trying to build a google app engine using servlets, filters etc.
How do i create a form in google app engine using java and store

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.