How to use existing Oracle sequence to generate id in hibernate?

后端 未结 10 1075
夕颜
夕颜 2020-12-04 19:53

I have legacy Oracle db with a sequence named PRODUCT_ID_SEQ.

Here is the mapping of Product class for which I need generate correct ids:<

10条回答
  •  醉梦人生
    2020-12-04 20:28

    I had the same issue while upgrading from 3.5.5 to 5.0.6.Final.

    I solved it by re-configuring mapping in the HBM file from:

        
            PRODUCT_ID_SEQ
        
    

    to:

         
            true 
            none
            1
            PRODUCT_ID_SEQ
        
    

提交回复
热议问题