Google App Engine datastore-primary key
Posted
by megala
on Stack Overflow
See other posts from Stack Overflow
or by megala
Published on 2010-03-19T05:30:33Z
Indexed on
2010/03/19
5:41 UTC
Read the original article
Hit count: 196
google-app-engine
Hi,
I've created a table in the Google App Engine Datastore. It contains the following FIELDS(GROUPNAME,GROUPID,GROUPDESC)
. How do I set GROUPID
as the primary key?
My code is as follows:
@Entity
@Table(name="group" , schema="PUBLIC")
public class Creategroup {
@Basic
private String groupname;
@Basic
private String groupid;
@Basic
private String groupdesc;
public void setGroupname(String groupname) {
this.groupname = groupname;
}
public String getGroupname() {
return groupname;
}
public void setGroupid(String groupid) {
this.groupid = groupid;
}
public String getGroupid() {
return groupid;
}
public void setGroupdesc(String groupdesc) {
this.groupdesc = groupdesc;
}
public String getGroupdesc() {
return groupdesc;
}
public Creategroup(String groupname, String groupid, String groupdesc
) {
// TODO Auto-generated constructor stub
this.groupname = groupname;
this.groupid = groupid;
this.groupdesc = groupdesc;
}
}
© Stack Overflow or respective owner