Your error is caused by the fact that your id
has the wrong type - int
is not allowed. A field annotated with @Id
can only be one of the following:
Long
long
String
If it is of type Long
then Objectify
will automatically generate the id for you providing you haven't already i.e. not initialised. If it is a String
or long
then you always have to provide the value yourself.
As @stickfigure mentioned your question has nothing to do with JDO annotations since you're using Objectify. Change your id type to Long
or long
and the error disappears, like so:
@Id long id;