java - Hibernate JPA check for a conflict when generating IDs -
i using postgresql database table may have inserts id set manually user, or need id generated using hibernate.
this may lead occurrence of generating id has been inserted database manually. there way hibernate can check collisions between generated id , existing ids?
hibernate cannot check that, because sequence allocated database. either:
- assign negative numbers manually inserted ids
- use uuid instead of sequences
Comments
Post a Comment