Reg Google app engine datastore -primarykey
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.
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.
精彩评论