且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Oracle序列时,Hibernate不会生成标识符

更新时间:2022-03-09 09:47:41

I找到了这个


SEQ_GEN使用名为my_sequence的序列定义了一个序列生成器。此基于序列的hilo算法使用的分配大小为20.请注意,此版本的Hibernate Annotations不处理序列生成器中的initialValue。默认的分配大小是50,所以如果你想使用一个序列并且每次拾取这个值,你必须将分配大小设置为1.

SEQ_GEN defines a sequence generator using a sequence named my_sequence. The allocation size used for this sequence based hilo algorithm is 20. Note that this version of Hibernate Annotations does not handle initialValue in the sequence generator. The default allocation size is 50, so if you want to use a sequence and pickup the value each time, you must set the allocation size to 1.

现在它工作正常