Java Google App Engine: what does @Persistent (valueStrategy = IdGeneratorStrategy.IDENTITY) do?

I was just starting to learn server / database stuff in Java, and I was wondering what the @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) piece of code @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) means / does. I am using google app engine

Thanks!

+4
source share
1 answer

That Java annotation defines the strategy that the annotated object will use.

This means that, for example, if you have a class Employee , it will be permanent, and the way that its primary key is generated will have a mechanism called IDENTITY , which automatically creates the following value for you,

This whole part of the API is called the Java Persistence API.

+3
source

Source: https://habr.com/ru/post/1313792/


All Articles