Skip to content

Commit

Permalink
CAY-2869 Upgrade handler v11 removes dbImport configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stariy95 committed Aug 27, 2024
1 parent db45019 commit 585676d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ default void updateExtensionSchema(UpgradeUnit upgradeUnit, String extension) {
}
for (int j = 0; j < nodes.getLength(); j++) {
Element element = (Element) nodes.item(j);
element.setAttribute("xmlns", "http://cayenne.apache.org/schema/"+getVersion()+"/"+extension);
element.setAttribute("xmlns", "http://cayenne.apache.org/schema/"+getVersion()+"/"+extension.toLowerCase());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void processProjectDom(UpgradeUnit upgradeUnit) {
public void processDataMapDom(UpgradeUnit upgradeUnit) {
updateDataMapSchemaAndVersion(upgradeUnit);
updateExtensionSchema(upgradeUnit, "cgen");
updateExtensionSchema(upgradeUnit, "dbimport");
updateExtensionSchema(upgradeUnit, "dbImport");
updateExtensionSchema(upgradeUnit, "graph");
upgradeComments(upgradeUnit);

Expand Down Expand Up @@ -151,7 +151,7 @@ private void updateDbImportConfig(UpgradeUnit upgradeUnit) {
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList nodes;
try {
nodes = (NodeList) xpath.evaluate("/data-map/*[local-name()='dbimport']/*[local-name()='usePrimitives']",
nodes = (NodeList) xpath.evaluate("/data-map/*[local-name()='dbImport']/*[local-name()='usePrimitives']",
upgradeUnit.getDocument(), XPathConstants.NODESET);
} catch (Exception e) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void testDbImportDomUpgrade() throws Exception {
Element root = document.getDocumentElement();

// check cgen config is updated
NodeList dbimport = root.getElementsByTagName("dbimport");
NodeList dbimport = root.getElementsByTagName("dbImport");
assertEquals(1, dbimport.getLength());
Node dbimportConfig = dbimport.item(0);
assertEquals("http://cayenne.apache.org/schema/11/dbimport",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<querySuperTemplate>templates/v4_1/datamap-superclass.vm</querySuperTemplate>
<client>true</client>
</cgen>
<dbimport xmlns="http://cayenne.apache.org/schema/10/dbimport">
<dbImport xmlns="http://cayenne.apache.org/schema/10/dbimport">
<defaultPackage>org.example</defaultPackage>
<usePrimitives>true</usePrimitives>
</dbimport>
</dbImport>
</data-map>

0 comments on commit 585676d

Please sign in to comment.