Is there something similar to this: @Insert(onConflict = OnConflictStrategy.REPLACE) as found in Room database that you can do in Objectbox. If not, how can you avoid saving duplicate entries in an objectbox entity? Thanks.
in object box DataModel class, make the item anotation
@unique Public String userID;
private Box<User> userBox;
userBox = ObjectBox.get().boxFor(User.class);
//your inserted object
if (!userBox.getAll().contains(insertedObject)){
leadBoxForLeadOpions.put(l);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With