Hibernate now defines several implicit naming strategies which can be defined via the
Code:
hibernate.implicit_naming_strategy
configuration property:
- default:: for org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl - an alias for jpa
- jpa:: for org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl - the JPA 2.0 compliant naming strategy
- legacy-hbm:: for org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl - compliant with the original Hibernate NamingStrategy
- legacy-jpa:: for org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl - compliant with the legacy NamingStrategy developed for JPA 1.0, which was, unfortunately, unclear in many respects regarding implicit naming rules.
However, the implicit FOREIGN KEY names are only defined in the ImplicitNamingStrategyJpaCompliantImpl.
Can you post the Hibernate 4 and the Hibernate 5 FOREIGN KEY differences to see if they could be easily resolved by the
Code:
legacy-hbm
implicit naming strategy, which was created to mimic the default naming strategy in Hibernate 4?