Migrate from Hibernate 4.3.6 to Hibernate 5

风格不统一 提交于 2019-12-04 06:38:58

As described here, I also migrate to from Hibernate 4 to Hibernate 5 to take advantage of the new Java LocalDateTime API, then I started having the same issue as you: ORA-02275: such a referential constraint already exists in the table.

I solved the issue by adding the property:<prop key="hibernate.id.new_generator_mappings">false</prop> as described here.

Then I started having another issue, like this one, where Hibernate was not finding the sequence, which in my case was solved by replacing all GenerationType.AUTO annotations by GenerationType.SEQUENCE.

UPDATE: Later, all my sequences values were getting multiplied by 50 like here, so I had to add this allocationSize = 1 in my domain classes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!