Migrate to Hibernate 7.0.x

Proprietary

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

io.moderne.hibernate.MigrateToHibernate70
mod run . --recipe=io.moderne.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 to Hibernate 7.0.x
  3. Migrate jackson-datatype-hibernate6 to jackson-datatype-hibernate7
  4. Change Gradle or Maven dependency io.hypersistence:hypersistence-utils-hibernate-63
  5. Remove a Gradle or Maven dependency org.hibernate.common:hibernate-commons-annotations
  6. Add Gradle or Maven dependency org.hibernate.orm:hibernate-core:7.0.x
  7. Remove a Gradle or Maven dependency org.hibernate:hibernate-proxool
  8. Remove a Gradle or Maven dependency org.hibernate:hibernate-vibur
  9. Remove annotation @org.hibernate.annotations.GeneratorType
  10. Remove annotation @org.hibernate.annotations.LazyToOne
  11. Remove annotation @org.hibernate.annotations.Loader
  12. Remove annotation @org.hibernate.annotations.Persister
  13. Remove annotation @org.hibernate.annotations.Proxy
  14. Remove annotation @org.hibernate.annotations.SelectBeforeUpdate
  15. Migrate @JdbcType and legacy @Type to @JdbcTypeCode
  16. Migrate Session interface method calls
  17. Migrate Session save/update/delete method calls
  18. Migrate NaturalIdLoadAccess method calls
  19. Migrate NaturalIdMultiLoadAccess method calls
  20. Replace hibernate annotations with Jakarta variants
  21. Migrate to @TargetEmbeddable
  22. Migrate implicit cascade=PERSIST for @Id and @MapsId associations
  23. Replace Session.buildLockRequest with LockOptions
  24. Migrate LockOptions to direct parameters
  25. Null safe Transaction#getTimeout()
  26. Change type Metamodel to JpaMetamodel
  27. Change type SqmQualifiedJoin to SqmJoin
  28. Change type org.hibernate.query.BindableType to org.hibernate.type.BindableType
  29. Change type org.hibernate.query.OutputableType to org.hibernate.type.OutputableType
  30. Change type org.hibernate.query.spi.BindingContext to org.hibernate.type.BindingContext
  31. Change method name jakarta.persistence.criteria.Expression as(Class) to cast
  32. Remove unnecessary cast to Session for SessionFactory.createEntityManager()
  33. Migrate setFlushMode() to setQueryFlushMode()
  34. Remove leaking of SharedSessionContractImplementor from org.hibernate.usertype.UserType invocations
  35. Remove leaking of SharedSessionContractImplementor from org.hibernate.usertype.UserType implementations
  36. Remove leaking of SessionFactoryImplementor from org.hibernate.usertype.CompositeUserType invocations and implementations
  37. Migrate MetamodelImplementor to Hibernate 7.0
  38. Migrate Configurable.configure() to use GeneratorCreationContext
  39. Migrate Hibernate Integrator#integrate method
  40. Migrate JPQL trunc() to cast(... as date)
  41. Migrate @Query to @NativeQuery for unsupported JPQL
  42. Find native queries with enum parameters requiring SpEL conversion
  43. Migrate to Hibernate 7 JFR APIs