What is the basic difference between when we use native
and increment
types id generator in hibernate.
As i was having a entity, in which the generator was previuosly native
, but then changed it to incremental
for some time, it was working properly. But just yesterday, when i changed in to native
again, the insertion is failing saying Contraint Violation
.
I have index set up in the id
field, which is auto generated.
Am i missing something here.
Thanks
Native is generated by DB - if DB do it. Increment - generates by hibernate that are unique only when no other process is inserting data into the same table.
精彩评论