Reputation: 1397
I created table in google Big table datastore ,In that the i set primary key using
@annotations as follows
@Id
@Column(name = "groupname")
private String groupname;
@Basic
private String groupdesc;
I worked corretly,but it override the previous record,how to solve this
for eg
if i entered
groupname=group1
groupdesc=groupdesc
than it accept after that i enter same groupname it override previous record for eg groupname=group1 groupdesc=groups
this record override previous one.
Upvotes: 0
Views: 106
Reputation: 101149
This is simply how the App Engine datastore works: It does not distinguish between insertions and updates. If you're not confident they keys you're generating yourself are unique, you either need to use auto generated keys, or check for existence before inserting a record.
Upvotes: 1