I just started learning server/database stuff on Java, and I was wondering what the piece of code @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
means/does. I am using Google’s App Engine
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s a Java annotation defining the strategy the annotated entity will use to be persisted.
It means, that, for instance if you have a
class Employee, it will be persistent, and the way its primary key will be generated, will be with a mechanism calledIDENTITYwhich automatically creates the next value for you.All this part of an API called Java Persistence API