Migrate dialects removed in Hibernate 7.0 to their generic equivalents
Recipe ID
org.openrewrite.hibernate.MigrateRemovedDialectsHibernate70Artifactorg.openrewrite.recipe:rewrite-hibernateHibernate 7.0 removed the remaining version- and storage-specific dialect subclasses that still existed in Hibernate 6.x. The IBM-i (DB2400*) variants map to DB2iDialect, not the generic DB2Dialect; the HANA row/column-store variants and MariaDB 10.6 collapse into the generic HANADialect / MariaDBDialect, which autodetect behavior from the JDBC connection.
Composite recipeMSAL
Add to your build
Get a download tokenThis recipe is Moderne licensed, so the token must belong to a Moderne customer. It replaces YOUR_DOWNLOAD_TOKEN below.
~/.gradle/gradle.properties
codeGenomeUsername=you@example.com
codeGenomeToken=YOUR_DOWNLOAD_TOKEN
build.gradle.kts
plugins {
id("org.openrewrite.rewrite") version("latest.release")
}
rewrite {
activeRecipe("org.openrewrite.hibernate.MigrateRemovedDialectsHibernate70")
}
repositories {
mavenCentral()
maven {
url = uri("https://artifacts.codegenomeproject.org/maven")
credentials {
username = providers.gradleProperty("codeGenomeUsername").get()
password = providers.gradleProperty("codeGenomeToken").get()
}
}
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-hibernate:2.27.0")
}
Then run
./gradlew rewriteRunUsage
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.MigrateRemovedDialectsHibernate70If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-hibernate:RELEASEDefinition
This recipe runs the following recipes in order.
- Change type
DB2400DialecttoDB2iDialectorg.openrewrite.java.ChangeType - Change type
DB2400V7R3DialecttoDB2iDialectorg.openrewrite.java.ChangeType - Change type
MariaDB106DialecttoMariaDBDialectorg.openrewrite.java.ChangeType - Change type
AbstractHANADialecttoHANADialectorg.openrewrite.java.ChangeType - Change type
HANAColumnStoreDialecttoHANADialectorg.openrewrite.java.ChangeType - Change type
HANACloudColumnStoreDialecttoHANADialectorg.openrewrite.java.ChangeType - Change type
HANARowStoreDialecttoHANADialectorg.openrewrite.java.ChangeType
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