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

后端 未结 10 1096
夕颜
夕颜 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:39

    The answer to the original question:

    @SequenceGenerator(name="EL_SEQ", sequenceName="EL_SEQ",allocationSize=1)
    

    It is allocationSize that sets the value to increment by.

提交回复
热议问题