开发者

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

I just started learning server/database stuff on Java, and I was wondering what the piece of code @Persistent(valu开发者_开发百科eStrategy = IdGeneratorStrategy.IDENTITY) means/does. I am using Google's App Engine

Thanks!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜