|
| 1 | +# |
| 2 | +# Copyright 2025 the original author or authors. |
| 3 | +# <p> |
| 4 | +# Licensed under the Moderne Source Available License (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# <p> |
| 8 | +# https://docs.moderne.io/licensing/moderne-source-available-license |
| 9 | +# <p> |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | + |
| 17 | +--- |
| 18 | +type: specs.openrewrite.org/v1beta/recipe |
| 19 | +name: org.openrewrite.java.migrate.datanucleus.UpgradeDataNucleus_4_0 |
| 20 | +displayName: Migrate to DataNucleus 4.0 |
| 21 | +description: >- |
| 22 | + Migrate DataNucleus 3.x applications to 4.0. This recipe handles package relocations, |
| 23 | + type renames, property key changes, and dependency updates introduced in AccessPlatform 4.0. |
| 24 | +tags: |
| 25 | + - datanucleus |
| 26 | + - jdo |
| 27 | + - jpa |
| 28 | +recipeList: |
| 29 | + - org.openrewrite.java.dependencies.UpgradeDependencyVersion: |
| 30 | + groupId: org.datanucleus |
| 31 | + artifactId: "*" |
| 32 | + newVersion: 4.0.x |
| 33 | + - org.openrewrite.java.dependencies.RemoveDependency: |
| 34 | + groupId: org.datanucleus |
| 35 | + artifactId: datanucleus-enhancer |
| 36 | + - org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_4_0 |
| 37 | + - org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_4_0 |
| 38 | + - org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_4_0 |
| 39 | + |
| 40 | +--- |
| 41 | +type: specs.openrewrite.org/v1beta/recipe |
| 42 | +name: org.openrewrite.java.migrate.datanucleus.DataNucleusPackageMoves_4_0 |
| 43 | +displayName: DataNucleus 4.0 package moves |
| 44 | +description: Relocate packages that were moved in DataNucleus 4.0. |
| 45 | +recipeList: |
| 46 | + - org.openrewrite.java.ChangePackage: |
| 47 | + oldPackageName: org.datanucleus.store.types.simple |
| 48 | + newPackageName: org.datanucleus.store.types.wrappers |
| 49 | + - org.openrewrite.java.ChangePackage: |
| 50 | + oldPackageName: org.datanucleus.store.types.backed |
| 51 | + newPackageName: org.datanucleus.store.types.wrappers.backed |
| 52 | + - org.openrewrite.java.ChangePackage: |
| 53 | + oldPackageName: org.datanucleus.query.evaluator.memory |
| 54 | + newPackageName: org.datanucleus.query.inmemory |
| 55 | + - org.openrewrite.java.ChangePackage: |
| 56 | + oldPackageName: org.datanucleus.query.node |
| 57 | + newPackageName: org.datanucleus.query.compiler |
| 58 | + - org.openrewrite.java.ChangePackage: |
| 59 | + oldPackageName: org.datanucleus.jta |
| 60 | + newPackageName: org.datanucleus.transaction.jta |
| 61 | + |
| 62 | +--- |
| 63 | +type: specs.openrewrite.org/v1beta/recipe |
| 64 | +name: org.openrewrite.java.migrate.datanucleus.DataNucleusTypeChanges_4_0 |
| 65 | +displayName: DataNucleus 4.0 type changes |
| 66 | +description: Rename types that were changed in DataNucleus 4.0. |
| 67 | +recipeList: |
| 68 | + - org.openrewrite.java.ChangeType: |
| 69 | + oldFullyQualifiedTypeName: org.datanucleus.PersistenceConfiguration |
| 70 | + newFullyQualifiedTypeName: org.datanucleus.Configuration |
| 71 | + - org.openrewrite.java.ChangeType: |
| 72 | + oldFullyQualifiedTypeName: org.datanucleus.JDOClassLoaderResolver |
| 73 | + newFullyQualifiedTypeName: org.datanucleus.ClassLoaderResolverImpl |
| 74 | + |
| 75 | +--- |
| 76 | +type: specs.openrewrite.org/v1beta/recipe |
| 77 | +name: org.openrewrite.java.migrate.datanucleus.DataNucleusProperties_4_0 |
| 78 | +displayName: DataNucleus 4.0 property migrations |
| 79 | +description: Rename property keys that changed in DataNucleus 4.0. |
| 80 | +recipeList: |
| 81 | + # Schema auto-create properties |
| 82 | + - org.openrewrite.properties.ChangePropertyKey: |
| 83 | + oldPropertyKey: datanucleus.autoCreateSchema |
| 84 | + newPropertyKey: datanucleus.schema.autoCreateAll |
| 85 | + - org.openrewrite.properties.ChangePropertyKey: |
| 86 | + oldPropertyKey: datanucleus.autoCreateTables |
| 87 | + newPropertyKey: datanucleus.schema.autoCreateTables |
| 88 | + - org.openrewrite.properties.ChangePropertyKey: |
| 89 | + oldPropertyKey: datanucleus.autoCreateColumns |
| 90 | + newPropertyKey: datanucleus.schema.autoCreateColumns |
| 91 | + - org.openrewrite.properties.ChangePropertyKey: |
| 92 | + oldPropertyKey: datanucleus.autoCreateConstraints |
| 93 | + newPropertyKey: datanucleus.schema.autoCreateConstraints |
| 94 | + # Schema validate properties |
| 95 | + - org.openrewrite.properties.ChangePropertyKey: |
| 96 | + oldPropertyKey: datanucleus.validateSchema |
| 97 | + newPropertyKey: datanucleus.schema.validateAll |
| 98 | + - org.openrewrite.properties.ChangePropertyKey: |
| 99 | + oldPropertyKey: datanucleus.validateTables |
| 100 | + newPropertyKey: datanucleus.schema.validateTables |
| 101 | + - org.openrewrite.properties.ChangePropertyKey: |
| 102 | + oldPropertyKey: datanucleus.validateColumns |
| 103 | + newPropertyKey: datanucleus.schema.validateColumns |
| 104 | + - org.openrewrite.properties.ChangePropertyKey: |
| 105 | + oldPropertyKey: datanucleus.validateConstraints |
| 106 | + newPropertyKey: datanucleus.schema.validateConstraints |
| 107 | + # Metadata properties |
| 108 | + - org.openrewrite.properties.ChangePropertyKey: |
| 109 | + oldPropertyKey: datanucleus.metadata.validate |
| 110 | + newPropertyKey: datanucleus.metadata.xml.validate |
| 111 | + - org.openrewrite.properties.ChangePropertyKey: |
| 112 | + oldPropertyKey: datanucleus.defaultInheritanceStrategy |
| 113 | + newPropertyKey: datanucleus.metadata.defaultInheritanceStrategy |
| 114 | + # Other |
| 115 | + - org.openrewrite.properties.ChangePropertyKey: |
| 116 | + oldPropertyKey: datanucleus.managedRuntime |
| 117 | + newPropertyKey: datanucleus.jmxType |
| 118 | + # XML equivalents |
| 119 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 120 | + elementName: property |
| 121 | + attributeName: name |
| 122 | + oldValue: datanucleus.autoCreateSchema |
| 123 | + newValue: datanucleus.schema.autoCreateAll |
| 124 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 125 | + elementName: property |
| 126 | + attributeName: name |
| 127 | + oldValue: datanucleus.autoCreateTables |
| 128 | + newValue: datanucleus.schema.autoCreateTables |
| 129 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 130 | + elementName: property |
| 131 | + attributeName: name |
| 132 | + oldValue: datanucleus.autoCreateColumns |
| 133 | + newValue: datanucleus.schema.autoCreateColumns |
| 134 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 135 | + elementName: property |
| 136 | + attributeName: name |
| 137 | + oldValue: datanucleus.autoCreateConstraints |
| 138 | + newValue: datanucleus.schema.autoCreateConstraints |
| 139 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 140 | + elementName: property |
| 141 | + attributeName: name |
| 142 | + oldValue: datanucleus.validateSchema |
| 143 | + newValue: datanucleus.schema.validateAll |
| 144 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 145 | + elementName: property |
| 146 | + attributeName: name |
| 147 | + oldValue: datanucleus.validateTables |
| 148 | + newValue: datanucleus.schema.validateTables |
| 149 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 150 | + elementName: property |
| 151 | + attributeName: name |
| 152 | + oldValue: datanucleus.validateColumns |
| 153 | + newValue: datanucleus.schema.validateColumns |
| 154 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 155 | + elementName: property |
| 156 | + attributeName: name |
| 157 | + oldValue: datanucleus.validateConstraints |
| 158 | + newValue: datanucleus.schema.validateConstraints |
| 159 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 160 | + elementName: property |
| 161 | + attributeName: name |
| 162 | + oldValue: datanucleus.metadata.validate |
| 163 | + newValue: datanucleus.metadata.xml.validate |
| 164 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 165 | + elementName: property |
| 166 | + attributeName: name |
| 167 | + oldValue: datanucleus.defaultInheritanceStrategy |
| 168 | + newValue: datanucleus.metadata.defaultInheritanceStrategy |
| 169 | + - org.openrewrite.xml.ChangeTagAttribute: |
| 170 | + elementName: property |
| 171 | + attributeName: name |
| 172 | + oldValue: datanucleus.managedRuntime |
| 173 | + newValue: datanucleus.jmxType |
0 commit comments