简体   繁体   English

JPA自动增量的差异

[英]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! 谢谢答案!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM