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 5838215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:26:39+00:00 2026-05-22T11:26:39+00:00

We are using JDO in one of our projects. This has been running for

  • 0

We are using JDO in one of our projects. This has been running for quite a while and naturally we need to change the model a bit.

What is the best practice when migrating fields in entity classes in JDO?

enum MyEnum {
    REGULAR,
    MYOLDTYPE // Delete this
}
@PersistenceCapable
public class Entity {
    @Persistent
    MyEnum myEnumType;
    @Persistent
    String myString; // Rename this

}

If I delete an enum value there will be an exception if it’s already persisted when loading from the database, how to migrate this?

If I would like to rename myString to myNewString, how to rename the column to the new name?

  • 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-22T11:26:40+00:00Added an answer on May 22, 2026 at 11:26 am

    Firstly look at your datastore (RDBMS?, something else?) to see if you are persisting as String or numeric-based.

    If you change the Enum then you’re responsible for either

    1. Migrate the content of the datastore

    2. Change the Enum definition so that Enum.valueOf(String) returns what you want the old value mapped to. Alternatively, if persisting to RDBMS, make use of DataNucleus extension at the foot of http://www.datanucleus.org/products/accessplatform_3_0/jdo/types.html where you define a method to get the Enum for a String value.

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

Sidebar

Related Questions

Assuming one has an operational Java application using DataNucleus's implementation of JDO to access
i need to update some entry in my data base using jdo in java
I'm using the GAE datastore with JDO to hold course information. Each Course has
Today it's the first time I'm using GWT and JDO. I am running it
I'm trying to write to a JDO store using this code: PersistenceManager pm =
I'm using the JDO Query class and I need to conditionally pass certain parameters
I am using GAE(Java) with JDO for persistence. I have an entity with a
I am using DataNucleus' implement of JDO on a local H2 database. I want
I am using Google App Engine with Google's JDO implementation to save an entity
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();

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.