ObjectDB ObjectDB

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?

 

 

edit
delete
#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)
edit
delete

Reply

To post on this website please sign in.