这个证件显示问题....
这两件事是相冲突的吗? ?
是的,它们是冲突的,没有意义。
当使用hibernate内置生成器'增量'时,通过从启动时的最大主键值开始计数来生成标识符是休眠的,在多JVM中不安全并使用数据库AUTO_INCREMENT,它是为新行生成唯一标识的数据库。
在mySQL DB中,如果使用AUTO_INCREMENT,则应该在映射中使用identity来让数据库安全地生成唯一标识。
来自hibernate文档
增量
$ b
身份 $ b
更多信息
I set generator as 'increment' in hbm file, and also i put auto_increment thing in database table also. This creteria showing issue ....
This both thing is conflicting ? ?
Yes they are conflicting, makes no sense..
When using hibernate built-in generator 'increment', it's hibernate that generate the identifiers by counting from the maximum primary key value at startup, not safe in multi JVM and using the database AUTO_INCREMENT it's the database that generate a unique identity for new rows.
In mySQL DB, if using AUTO_INCREMENT you should use identity in your mapping to let the database safely generate unique identity.
From hibernate documentation
increment
identity
More information
Hibernate Doc section 5.1.4.1. Generator
My sql AUTO_INCREMENT documentation
这篇关于休眠生成器增量与表自动增量冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!