Changing Primary Key

#1

I have a "Table" that currently has 

    @Id
    private String userId;
    @Id
    private long range;

private String someOtherField;

I need to add a @Id to someOtherField.  But when I add that, and query the table all the PK fields are null or 0.  What can I do to modify primary keys?

 

 

#2

ObjectDB doesn't support changing primary keys, as it may break references to objects, indexes, etc.

You can always migrate data to a new class.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login