views:

34

answers:

1

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!

+3  A: 

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 called IDENTITY which automatically creates the next value for you.

All this part of an API called Java Persistence API

OscarRyz
Thank you for your answer and the references!
ayanonagon