There exists a proprietary hibernate annotation to specify the Foreign Key constraint names that are used at DDL generation time: org.hibernate.annotations.ForeignKey
.
Is there also a way to specify the Primary Key constraint names?
There exists a proprietary hibernate annotation to specify the Foreign Key constraint names that are used at DDL generation time: org.hibernate.annotations.ForeignKey
.
Is there also a way to specify the Primary Key constraint names?
If you're talking about choosing the name of your primary key (in the database), Hibernate can not do that.
Remember, Hibernate is a framework that is primarly focused on mapping objects, not on the creation/maintenance of database entities.
With regards to defining the primary key, the following link (particularly 2.2.3.2) might be helpful: Mapping identifier properties in the JBoss Hibernate guide
Not possible with standard JPA and not supported by Hibernate for Primary Key constraints neither.
There is actually a very old issue about this feature request (HB-1245) but it looks like it doesn't get much attention.