Migrate to Hibernate 7.0.x

MSAL

This recipe will apply changes commonly needed when migrating to Hibernate 7.0.x.

org.openrewrite.hibernate.MigrateToHibernate70
mod run . --recipe=org.openrewrite.hibernate.MigrateToHibernate70

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate to Hibernate 6.6.x
  2. Migrate persistence.xml to Jakarta Persistence 3.2
  3. Migrate Hibernate Types to Hypersistence Utils for Hibernate 7.0
  4. Migrate dialects removed in Hibernate 7.0 to their generic equivalents
  5. Upgrade Gradle or Maven dependency versions org.hibernate.orm:*:7.0.x
  6. Change Gradle or Maven dependency org.hibernate.orm:hibernate-jpamodelgen
  7. Change Maven plugin group and artifact ID org.hibernate.orm:hibernate-maven-plugin
  8. Upgrade Maven plugin version org.hibernate.orm:hibernate-maven-plugin:7.0.x
  9. Change type AdditionalJaxbMappingProducer to AdditionalMappingContributor
  10. Change type MetadataContributor to AdditionalMappingContributor
  11. Change type SqmQualifiedJoin to SqmJoin
  12. Change method name org.hibernate.Session save(Object) to persist
  13. Change method name org.hibernate.Session save(String, Object) to persist
  14. Change method name org.hibernate.Session delete(Object) to remove
  15. Change method name org.hibernate.Session delete(String, Object) to remove
  16. Change method name org.hibernate.Session get(Class, java.io.Serializable) to find
  17. Change method name org.hibernate.Session get(String, java.io.Serializable) to find
  18. Change method name org.hibernate.Session load(Class, java.io.Serializable) to getReference
  19. Change method name org.hibernate.Session load(String, java.io.Serializable) to getReference
  20. Replace constant with another constant
  21. Remove @GeneratedValue strategy when a custom @GenericGenerator is used