Student s1 = new Student();
s1.rollNo = "44";
s1.name = "kk";
db4o().save(s1);
Student s2 = new Student();
s2.rollNo = "44";
s2.name = "kk";
db4o().save(s2);
here I save two objects s1 and s2 in the DB4o database, and both objects are saved even if they have duplicate information, what I want is the same rollNo student should only be saved once, as relational databases using primary the key. I know that DB4o saves objects based on the reference address, correct me if I am wrong. Please let me know if there is a way to get primary key functionality to avoid data redundancy in DB4o.
thanks
source
share