How do I change the primary key in ObjectBox?

297 Views Asked by At

The primary key existed before and now it needs to be made new.

This is how I modified it, but duplicate data will appear.

Before:

@Entity
class A {
    @Id(assignable = true)
    long id;
}

Now:

@Entity
class A {
    @Id
    long boxId;
    long id;
}
0

There are 0 best solutions below