Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dependencies {

implementation(platform("org.openrewrite:rewrite-bom:${rewriteVersion}"))
implementation("org.openrewrite:rewrite-java")
implementation("org.openrewrite:rewrite-properties")
implementation("org.openrewrite:rewrite-xml")
implementation("org.openrewrite:rewrite-json")
implementation("org.openrewrite:rewrite-maven")
implementation("org.openrewrite:rewrite-gradle")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2025 the original author or authors.
* <p>
* Licensed under the Moderne Source Available License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://docs.moderne.io/licensing/moderne-source-available-license
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NullMarked
@NonNullFields
package org.openrewrite.java.migrate.datanucleus;

import org.jspecify.annotations.NullMarked;
import org.openrewrite.internal.lang.NonNullFields;
5 changes: 5 additions & 0 deletions src/main/resources/META-INF/rewrite/category.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ type: specs.openrewrite.org/v1beta/category
name: Lombok
packageName: org.openrewrite.java.migrate.lombok
description: Recipes for working with [Lombok](https://projectlombok.org/).
---
type: specs.openrewrite.org/v1beta/category
name: DataNucleus
packageName: org.openrewrite.java.migrate.datanucleus
description: Recipes for migrating [DataNucleus](https://www.datanucleus.org/) JDO/JPA persistence applications.
173 changes: 173 additions & 0 deletions src/main/resources/META-INF/rewrite/datanucleus-4.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#
# Copyright 2025 the original author or authors.
# <p>
# Licensed under the Moderne Source Available License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://docs.moderne.io/licensing/moderne-source-available-license
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.UpgradeDataNucleus_4_0
displayName: Migrate to DataNucleus 4.0
description: >-
Migrate DataNucleus 3.x applications to 4.0. This recipe handles package relocations,
type renames, property key changes, and dependency updates introduced in AccessPlatform 4.0.
tags:
- datanucleus
- jdo
- jpa
recipeList:
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.datanucleus
artifactId: "*"
newVersion: 4.0.x
- org.openrewrite.java.dependencies.RemoveDependency:
groupId: org.datanucleus
artifactId: datanucleus-enhancer
- org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_4_0
- org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_4_0
- org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_4_0

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_4_0
displayName: DataNucleus 4.0 package moves
description: Relocate packages that were moved in DataNucleus 4.0.
recipeList:
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.store.types.simple
newPackageName: org.datanucleus.store.types.wrappers
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.store.types.backed
newPackageName: org.datanucleus.store.types.wrappers.backed
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.query.evaluator.memory
newPackageName: org.datanucleus.query.inmemory
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.query.node
newPackageName: org.datanucleus.query.compiler
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.jta
newPackageName: org.datanucleus.transaction.jta

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_4_0
displayName: DataNucleus 4.0 type changes
description: Rename types that were changed in DataNucleus 4.0.
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.datanucleus.PersistenceConfiguration
newFullyQualifiedTypeName: org.datanucleus.Configuration
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.datanucleus.JDOClassLoaderResolver
newFullyQualifiedTypeName: org.datanucleus.ClassLoaderResolverImpl

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_4_0
displayName: DataNucleus 4.0 property migrations
description: Rename property keys that changed in DataNucleus 4.0.
recipeList:
# Schema auto-create properties
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.autoCreateSchema
newPropertyKey: datanucleus.schema.autoCreateAll
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.autoCreateTables
newPropertyKey: datanucleus.schema.autoCreateTables
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.autoCreateColumns
newPropertyKey: datanucleus.schema.autoCreateColumns
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.autoCreateConstraints
newPropertyKey: datanucleus.schema.autoCreateConstraints
# Schema validate properties
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.validateSchema
newPropertyKey: datanucleus.schema.validateAll
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.validateTables
newPropertyKey: datanucleus.schema.validateTables
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.validateColumns
newPropertyKey: datanucleus.schema.validateColumns
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.validateConstraints
newPropertyKey: datanucleus.schema.validateConstraints
# Metadata properties
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.metadata.validate
newPropertyKey: datanucleus.metadata.xml.validate
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.defaultInheritanceStrategy
newPropertyKey: datanucleus.metadata.defaultInheritanceStrategy
# Other
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.managedRuntime
newPropertyKey: datanucleus.jmxType
# XML equivalents
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.autoCreateSchema
newValue: datanucleus.schema.autoCreateAll
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.autoCreateTables
newValue: datanucleus.schema.autoCreateTables
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.autoCreateColumns
newValue: datanucleus.schema.autoCreateColumns
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.autoCreateConstraints
newValue: datanucleus.schema.autoCreateConstraints
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.validateSchema
newValue: datanucleus.schema.validateAll
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.validateTables
newValue: datanucleus.schema.validateTables
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.validateColumns
newValue: datanucleus.schema.validateColumns
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.validateConstraints
newValue: datanucleus.schema.validateConstraints
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.metadata.validate
newValue: datanucleus.metadata.xml.validate
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.defaultInheritanceStrategy
newValue: datanucleus.metadata.defaultInheritanceStrategy
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.managedRuntime
newValue: datanucleus.jmxType
113 changes: 113 additions & 0 deletions src/main/resources/META-INF/rewrite/datanucleus-5.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#
# Copyright 2025 the original author or authors.
# <p>
# Licensed under the Moderne Source Available License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://docs.moderne.io/licensing/moderne-source-available-license
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.UpgradeDataNucleus_5_0
displayName: Migrate to DataNucleus 5.0
description: >-
Migrate DataNucleus 4.x applications to 5.0. This recipe handles package relocations,
type renames, property key changes, and dependency updates.
tags:
- datanucleus
- jdo
- jpa
recipeList:
- org.openrewrite.java.migrate.datanucleus.UpgradeDataNucleus_4_0
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
groupId: org.datanucleus
artifactId: "*"
newVersion: 5.0.x
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: org.datanucleus
oldArtifactId: datanucleus-connection-pool
newGroupId: org.datanucleus
newArtifactId: datanucleus-connection-pool2
newVersion: 5.0.x
- org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_5_0
- org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_5_0
- org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_5_0

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_5_0
displayName: DataNucleus 5.0 package moves
description: Relocate packages that were moved in DataNucleus 5.0.
recipeList:
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.query.cache
newPackageName: org.datanucleus.query.compiler
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.query.symbol
newPackageName: org.datanucleus.query.compiler
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.store.encryption
newPackageName: org.datanucleus.store
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.store.scostore
newPackageName: org.datanucleus.store.types.scostore
- org.openrewrite.java.ChangePackage:
oldPackageName: org.datanucleus.store.exceptions
newPackageName: org.datanucleus.exceptions

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_5_0
displayName: DataNucleus 5.0 type changes
description: Rename types that were changed in DataNucleus 5.0.
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.datanucleus.store.rdbms.adapter.MSSQLServerAdapter
newFullyQualifiedTypeName: org.datanucleus.store.rdbms.adapter.SQLServerAdapter

---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_5_0
displayName: DataNucleus 5.0 property migrations
description: Rename property keys that changed in DataNucleus 5.0.
recipeList:
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.query.compileOptimiser
newPropertyKey: datanucleus.query.compileOptimiseVarThis
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.rdbms.adapter.informixUseSerialForIdentity
newPropertyKey: datanucleus.rdbms.informix.useSerialForIdentity
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.rdbms.oracleNlsSortOrder
newPropertyKey: datanucleus.rdbms.oracle.nlsSortOrder
- org.openrewrite.properties.ChangePropertyKey:
oldPropertyKey: datanucleus.schema.autoCreateSchema
newPropertyKey: datanucleus.schema.autoCreateDatabase
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.query.compileOptimiser
newValue: datanucleus.query.compileOptimiseVarThis
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.rdbms.adapter.informixUseSerialForIdentity
newValue: datanucleus.rdbms.informix.useSerialForIdentity
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.rdbms.oracleNlsSortOrder
newValue: datanucleus.rdbms.oracle.nlsSortOrder
- org.openrewrite.xml.ChangeTagAttribute:
elementName: property
attributeName: name
oldValue: datanucleus.schema.autoCreateSchema
newValue: datanucleus.schema.autoCreateDatabase
Loading
Loading