Hibernate: ID generator using increment and Oracle Schema

后端 未结 2 1179
余生分开走
余生分开走 2021-01-06 10:31

I am using Hiberbnate 3.1.3. I have a mapping as below and when I try to insert a record into the TEST_TABLE, I get an Exception: \'Exception in thread \"main\" org.hibernat

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-06 10:54

    If the hibernate default schema is OTHER_SCHEMA then if you do not supply a schema for a table then it will automatically add the default

    Solution is you have to add a schema for all table names except one the default. In this case you might be better off if you set the hibernate default to your schema.

    Looking at the sequence using max(id) like that is not usually efficient, especially in Oracle which has sequences exactly for this use.

提交回复
热议问题