why isn’t it possible to define another key than
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
?
If i try to define a @PrimaryKey as say, an Integer I get an Server Error…
http://code.google.com/intl/de-DE/appengine/docs/java/datastore/dataclasses.html
why isn’t it possible to define another key than @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private
Share
Yes, you can use a Long
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
or a String
@PrimaryKey
private String name;
See http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html