Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JPA, Hibernate: Custom primary key generator, before persist

843859Jun 22 2009 — edited Jun 23 2009
Hello,

I'm working with JPA and Hibernate, and project requirement is to have primary key (id) value in application, before entity is persisted. JPA and Hibernate have techniques for generating id's during persist, but I need those id's before, and I need them to be unique. Is there already conventional solution for this?
If not, what are suggestions? Creating new entity and new database table just for id's?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2009
Added on Jun 22 2009
10 comments
1,463 views