Migrate to Hibernate 6.0.x
Recipe ID
org.openrewrite.hibernate.MigrateToHibernate60Artifact
org.openrewrite.recipe:rewrite-hibernateThis recipe will apply changes commonly needed when migrating to Hibernate 6.0.x. The hibernate dependencies will be updated to use the new org.hibernate.orm group ID and the recipe will make changes necessary to use Hibernate with Jakarta EE 9.0.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.hibernate.MigrateToHibernate60If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-hibernate:2.24.0Definition
This recipe runs the following recipes in order.
- Migrate Hibernate dependencies to 6.0.x
org.openrewrite.hibernate.MigrateToHibernateDependencies60 - AddScalarPreferStandardBasicTypesForHibernate5
org.openrewrite.hibernate.AddScalarPreferStandardBasicTypes - Replace
extends EmptyInterceptorwithimplements Interceptorand potentiallyStatementInspectororg.openrewrite.hibernate.EmptyInterceptorToInterface - Replace boolean type mappings with converters
org.openrewrite.hibernate.MigrateBooleanMappings @Typeannotation type parameter migrationorg.openrewrite.hibernate.TypeAnnotationParameter- Rename
JavaTypeDescriptorandSqlTypeDescriptortoJavaTypeandSqlTypeorg.openrewrite.hibernate.TypeDescriptorToType - Migrate deprecated
javax.persistencepackages tojakarta.persistenceorg.openrewrite.java.migrate.jakarta.JavaxPersistenceToJakartaPersistence - Migrate xmlns entries in
persistence.xmlfilesorg.openrewrite.java.migrate.jakarta.JavaxPersistenceXmlToJakartaPersistenceXml - Migrate Hibernate Types to Hypersistence Utils 6.0
org.openrewrite.hibernate.MigrateToHypersistenceUtilsHibernate60
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats