Closed Mister-Seven closed 7 years ago
if i use @Id to annotate like below:
@Entity public class User {
@Id public long id; public String num; public String phone; public String password; public String username;
}
when i first invoke like below:
BoxStore mBoxStore = BaseApplication.instance.getBoxStore();
mUserBox = mBoxStore.boxFor(User.class);
mUserBox.put(mUser); // first insert
then throw Exception below:
java.lang.IllegalArgumentException: ID is higher or equal to internal ID sequence: 24148 (vs. 1). Use ID 0
(zero) to insert new entities.
the 24148 value is from server.
any help ?????
Use @Id(assignable = true) - check the docs for details.
@Id(assignable = true)
Feel free to reopen if that is not working for you.
It works. 3Q
if i use @Id to annotate like below:
@Entity public class User {
}
when i first invoke like below:
BoxStore mBoxStore = BaseApplication.instance.getBoxStore();
mUserBox = mBoxStore.boxFor(User.class);
mUserBox.put(mUser); // first insert
then throw Exception below:
java.lang.IllegalArgumentException: ID is higher or equal to internal ID sequence: 24148 (vs. 1). Use ID 0
(zero) to insert new entities.
the 24148 value is from server.
any help ?????