Hibernate generates negative id values when using a sequence

前端 未结 3 804
粉色の甜心
粉色の甜心 2020-11-29 23:00

I have a class with the following definition:

@Id
@SequenceGenerator(name = \"SEQ_ACE_WORKERS_QUEUE_STATS_ID\", sequenceName = \"SEQ_ACE_WORKERS_QUEUE_STATS_         


        
3条回答
  •  长情又很酷
    2020-11-29 23:37

    Setting hibernate.id.new_generator_mappings to false in my persistence.xml was just the first part of the solution to my problem:

    To completely solve the problem I added the allocationSize to 1 in the @SequenceGenerator (which I was omitting).

提交回复
热议问题