[英]Differences in JPA auto increment
When I want to set my PK auto increment(MySQL), I can do it by table settings in database, or by anotation 当我要设置PK自动增量(MySQL)时,可以通过数据库中的表设置或注释来完成
@GeneratedValue(strategy=GenerationType.IDENTITY)
My question is, what is difference and why use which access. 我的问题是,有什么区别,为什么要使用哪个访问权限。 Is one of them better? 其中之一更好吗? Thanx for answers! 谢谢答案!
I would have thought that the docs for any JPA implementation would explain all of that http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Entities/Ids/GeneratedValue 我以为任何JPA实施的文档都可以解释所有这些http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Entities/Ids/GeneratedValue
http://www.datanucleus.org/products/accessplatform_4_0/jpa/value_generation.html http://www.datanucleus.org/products/accessplatform_4_0/jpa/value_generation.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.