Skip to content

Commit

Permalink
MCR-2647 update to hibernate 6.3 and H2 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yagee-de committed Oct 13, 2023
1 parent 5409514 commit 9fd1482
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion mir-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.176</version>
<version>2.2.224</version>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
14 changes: 7 additions & 7 deletions mir-it/src/test/integration/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
version="3.1">
<persistence-unit name="MyCoRe" transaction-type="RESOURCE_LOCAL">
<!-- http://stackoverflow.com/questions/15026302/multiple-jars-single-persistence-unit-solution -->
<mapping-file>META-INF/mycore-base-mappings.xml</mapping-file>
Expand All @@ -14,10 +14,10 @@
<!-- required for MIR only: -->
<mapping-file>META-INF/mir-module-mappings.xml</mapping-file>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:h2:${MCR.Home.Integration}/${MCR.AppName}/data/h2/mir" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="javax.persistence.jdbc.password" value="" />
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:${MCR.Home.Integration}/${MCR.AppName}/data/h2/mir" />
<property name="jakarta.persistence.jdbc.user" value="sa" />
<property name="jakarta.persistence.jdbc.password" value="" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.jdbc.batch_size" value="0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static void chooseCategory(HttpServletRequest request) {
Element rootElement = getRootElement(request);
rootElement.setAttribute("classID", categoryID.getRootID());
if (!categoryID.isRootID()) {
rootElement.setAttribute("categID", categoryID.getID());
rootElement.setAttribute("categID", categoryID.getId());
}
request.setAttribute(LAYOUT_ELEMENT_KEY, new Document(rootElement));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public SolrInputDocument getDocument(Path input, BasicFileAttributes attr) {
LOGGER.warn("No status set for " + objId + ", could not set for MCRFile: " + input);
return document;
}
document.setField(status.getRootID(), status.getID());
document.setField(status.getRootID(), status.getId());
return document;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static void harmonizeDerivatesGenre(String id) {
0,
null,
derivateTypeId.getRootID(),
derivateTypeId.getID()
derivateTypeId.getId()
);

object.getStructure().getDerivates().forEach(derivateLink -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static void fixModsNameIdentifier(String classification, MCRCategoryID r

MCRCategory category = foundCategoryByLabel.iterator().next();
LOGGER.info("Found single matching category: " + category.toString());
nameIdentifier.setAttribute("type", category.getId().getID());
nameIdentifier.setAttribute("type", category.getId().getId());
update.set(true);

if (nameIdentifier.getAttributeValue("typeURI") != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public MCRObjectID ingestMetadata(Deposit deposit) throws SwordError, SwordServe
0,
null,
derivateTypeId.getRootID(),
derivateTypeId.getID()
derivateTypeId.getId()
);
derivate.getDerivate().getClassifications().add(derivateTypeClassification);
}
Expand Down
14 changes: 7 additions & 7 deletions mir-module/src/test/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
version="3.1">
<persistence-unit name="mir-module" transaction-type="RESOURCE_LOCAL">
<!-- http://stackoverflow.com/questions/15026302/multiple-jars-single-persistence-unit-solution -->
<mapping-file>META-INF/mycore-acl-mappings.xml</mapping-file>
Expand All @@ -11,10 +11,10 @@
<mapping-file>META-INF/mycore-pi-mappings.xml</mapping-file>
<mapping-file>META-INF/mir-module-mappings.xml</mapping-file>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:mycore" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="javax.persistence.jdbc.password" value="" />
<property name="jakarta.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:hsqldb:mem:mycore" />
<property name="jakarta.persistence.jdbc.user" value="sa" />
<property name="jakarta.persistence.jdbc.password" value="" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.jdbc.batch_size" value="0" />
<property name="hibernate.show_sql" value="false" />
Expand Down
14 changes: 7 additions & 7 deletions mir-wizard/src/main/resources/setup/dbtypes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
<url>jdbc:h2:file:{PATH}/h2/mir</url>
<username>sa</username>
<library>
<url>https://repo.maven.apache.org/maven2/com/h2database/h2/1.4.200/h2-1.4.200.jar</url>
<url>https://repo1.maven.org/maven2/com/h2database/h2/2.2.224/h2-2.2.224.jar</url>
</library>
</db>
<db name="PostgreSQL">
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgresql://127.0.0.1/mir</url>
<library>
<url>https://jdbc.postgresql.org/download/postgresql-42.2.9.jar</url>
<url>https://repo.maven.apache.org/maven2/org/postgresql/postgresql/42.2.9/postgresql-42.2.9.jar</url>
<url>https://jdbc.postgresql.org/download/postgresql-42.6.0.jar</url>
<url>https://repo1.maven.org/maven2/org/postgresql/postgresql/42.6.0/postgresql-42.6.0.jar</url>
</library>
</db>
<db name="HSQLDB">
<driver>org.hsqldb.jdbcDriver</driver>
<url>jdbc:hsqldb:hsql://localhost:8298/mir</url>
<username>sa</username>
<library>
<url>https://repo.maven.apache.org/maven2/org/hsqldb/hsqldb/2.5.0/hsqldb-2.5.0.jar</url>
<url>https://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.7.2/hsqldb-2.7.2.jar</url>
</library>
</db>
<db name="MariaDB">
<driver>org.mariadb.jdbc.Driver</driver>
<url>jdbc:mariadb://127.0.0.1/mir</url>
<library>
<url>https://repo.maven.apache.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.5.4/mariadb-java-client-2.5.4.jar</url>
<url>https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/3.2.0/mariadb-java-client-3.2.0.jar</url>
</library>
</db>
<db name="MySQL">
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://127.0.0.1/mir</url>
<library>
<url>https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar</url>
<url>https://repo1.maven.org/maven2/com/mysql/mysql-connector-j/8.1.0/mysql-connector-j-8.1.0.jar</url>
</library>
</db>
</dbtypes>
</dbtypes>
6 changes: 3 additions & 3 deletions mir-wizard/src/main/resources/setup/template-persistence.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
version="3.1">
<persistence-unit name="MyCoRe" transaction-type="RESOURCE_LOCAL">
<mapping-file>META-INF/mycore-base-mappings.xml</mapping-file>
<mapping-file>META-INF/mycore-iview2-mappings.xml</mapping-file>
Expand Down
14 changes: 7 additions & 7 deletions mir-wizard/src/test/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
version="3.1">
<persistence-unit name="mir-wizard" transaction-type="RESOURCE_LOCAL">
<!-- http://stackoverflow.com/questions/15026302/multiple-jars-single-persistence-unit-solution -->
<mapping-file>META-INF/mycore-base-mappings.xml</mapping-file>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:mir" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="javax.persistence.jdbc.password" value="" />
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:mir" />
<property name="jakarta.persistence.jdbc.user" value="sa" />
<property name="jakarta.persistence.jdbc.password" value="" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.jdbc.batch_size" value="0" />
<property name="hibernate.show_sql" value="false" />
Expand Down

0 comments on commit 9fd1482

Please sign in to comment.