Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Upgrade Hibernate OGM to 5.4 and Apache Ignite to 2.6 #22

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ cache:
env:
global:
install:
# install latest Hibernate OGM snapshot
- git clone https://github.com/hibernate/hibernate-ogm.git
- cd hibernate-ogm
# The Maven install provided by Travis is outdated, use Maven wrapper to get the latest version
- mvn -N -q io.takari:maven:wrapper
- ./mvnw -v
- travis_wait ./mvnw install -B -q -s settings-example.xml -am -pl bom,core -DskipITs -DskipDistro -DskipDocs -DskipTests
- cd ..
# # install latest Hibernate OGM snapshot
# - git clone https://github.com/hibernate/hibernate-ogm.git
# - cd hibernate-ogm
# # The Maven install provided by Travis is outdated, use Maven wrapper to get the latest version
# - mvn -N -q io.takari:maven:wrapper
# - ./mvnw -v
# - travis_wait ./mvnw install -B -q -s settings-example.xml -am -pl bom,core -DskipITs -DskipDistro -DskipDocs -DskipTests
# - cd ..
# The Maven install provided by Travis is outdated, use Maven wrapper to get the latest version
- mvn -N -q io.takari:maven:wrapper
# first run to download all the Maven dependencies without logging
- travis_wait ./mvnw install -B -q -s settings-example.xml -Ptest -DskipTests=true -Dmaven.javadoc.skip=true -DskipDistro=true
- travis_wait ./mvnw install -B -q -s settings-example.xml -Ptest -DskipTests -DskipDocs -DskipITs -DskipDistro
# we run checkstyle first to fail fast if there is a styling error
- ./mvnw -s settings-example.xml -DskipDistro=true checkstyle:check
matrix:
Expand Down
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
6 changes: 1 addition & 5 deletions documentation/javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-documentation</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -29,10 +29,6 @@
<dependencies>
<!-- We need the dependencies having annotations we're using
to workaround a javadoc tool bug -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions documentation/manual/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -55,7 +55,7 @@
<artifactItem>
<groupId>org.hibernate.infra</groupId>
<artifactId>hibernate-asciidoctor-theme</artifactId>
<version>${hibernate-asciidoctor-theme.version}</version>
<version>${version.org.hibernate.infra.hibernate-asciidoctor-theme}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/</outputDirectory>
Expand Down
2 changes: 1 addition & 1 deletion documentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion ignite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public void removeAssociation(AssociationKey key, AssociationContext association
}
}
else if ( key.getMetadata().getAssociationKind() == AssociationKind.EMBEDDED_COLLECTION ) {
Object id = ( (IgniteTupleSnapshot) associationContext.getEntityTuplePointer().getTuple().getSnapshot() ).getCacheKey();
Object id = provider.createParentKeyObject( key );
BinaryObject binaryObject = associationCache.get( id );
Contracts.assertNotNull( binaryObject, "binaryObject" );
BinaryObjectBuilder binaryObjectBuilder = provider.createBinaryObjectBuilder( binaryObject );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class IgniteEmbeddedAssociationSnapshot implements AssociationSnapshot {
public IgniteEmbeddedAssociationSnapshot(AssociationKey associationKey, Tuple tuple) {
this.associationMetadata = associationKey.getMetadata();
this.tuple = tuple;
BinaryObject obj = ( (IgniteTupleSnapshot) tuple.getSnapshot() ).getCacheValue();
BinaryObject obj = tuple != null ? ( (IgniteTupleSnapshot) tuple.getSnapshot() ).getCacheValue() : null;
Object objects[] = obj != null ? (Object[]) obj.field( StringHelper.realColumnName( associationMetadata.getCollectionRole() ) ) : null;
rows = new HashMap<>();
if ( objects != null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

import org.hibernate.QueryException;
import org.hibernate.engine.query.spi.ParameterParser;
import org.hibernate.ogm.datastore.ignite.logging.impl.Log;
import org.hibernate.ogm.datastore.ignite.logging.impl.LoggerFactory;
import org.hibernate.persister.collection.SQLLoadableCollection;
import org.hibernate.persister.entity.SQLLoadable;

Expand All @@ -23,6 +25,8 @@
*/
public class IgniteSqlQueryParser {

private static final Log log = LoggerFactory.getLogger();

private static final String HIBERNATE_PLACEHOLDER_PREFIX = "h-";
private static final String DOMAIN_PLACEHOLDER = "h-domain";
private static final String CATALOG_PLACEHOLDER = "h-catalog";
Expand Down Expand Up @@ -346,8 +350,8 @@ public void namedParameter(String name, int position) {
}

@Override
public void jpaPositionalParameter(String name, int position) {
namedParameter( name, position );
public void jpaPositionalParameter(int identifier, int position) {
throw new UnsupportedOperationException( "jpaPositionalParameter() is not implemented" );
}

@Override
Expand All @@ -371,6 +375,11 @@ else if ( o instanceof Integer ) {
( (List) o ).add( loc );
}
}

@Override
public void complete() {
throw new UnsupportedOperationException( "complete() is not implemented" );
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public static void escapeString(StringBuilder builder, String input, char escape
/**
* Normalizes an identifier to make it SQL-safe,
* e. g. "&lt;gen_0&gt;" -&gt; "_gen_0_"
* @param identifier - identifier
* @return normalized identifier
*/
public static String sqlNormalize(String identifier) {
StringBuilder sb = new StringBuilder( identifier );
Expand Down
4 changes: 4 additions & 0 deletions ignite/src/test/resources/skipTests
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,8 @@ org.hibernate.ogm.backendtck.associations.collection.unidirectional.CollectionUn
org.hibernate.ogm.backendtck.associations.manytoone.ManyToOneTest#testUnidirectionalManyToOne
org.hibernate.ogm.backendtck.jpa.JPAResourceLocalTest#testBootstrapAndCRUD

// ogm 5.4
org.hibernate.ogm.backendtck.queries.AggregateOperationQueryTest
org.hibernate.ogm.backendtck.storedprocedures.NamedParametersStoredProcedureCallTest
org.hibernate.ogm.backendtck.storedprocedures.PositionalParametersStoredProcedureCallTest

37 changes: 9 additions & 28 deletions integrationtest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
</parent>

<artifactId>hibernate-ogm-ignite-integrationtest</artifactId>
Expand All @@ -16,9 +16,8 @@

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Skipping enforcer plug-in as AS/Arquillian cause several dependency
convergence issues -->
<enforcer.skip>true</enforcer.skip>
<!-- Skipping enforcer dependency convergence check as AS/Arquillian cause several dependency convergence issues -->
<enforcer.dependencyconvergence.skip>true</enforcer.dependencyconvergence.skip>

<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
Expand All @@ -29,7 +28,7 @@
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${arquillianVersion}</version>
<version>${version.org.jboss.arquillian}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -124,24 +123,6 @@
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-orm-modules</artifactId>
<version>${hibernateVersion}</version>
<classifier>${hibernateWildflyClassifier}</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${jboss.home}/modules</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>hibernate-ogm-modules</artifactId>
<classifier>${hibernateWildflyClassifier}</classifier>
<version>${project.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${jboss.home}/modules</outputDirectory>
</artifactItem>
<!-- modules for Apache Ignite dialect -->
<artifactItem>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -172,7 +153,7 @@
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${wildflyArquillianVersion}</version>
<version>${version.org.wildfly.arquillian}</version>
<scope>test</scope>
<exclusions>
<!-- Pulled in transitively; Neither available on
Expand Down Expand Up @@ -207,18 +188,18 @@
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.2_spec</artifactId>
<version>1.0.0.Final</version>
<version>${version.org.jboss.spec.javax.ejb.jboss-ejb-api_3.2_spec}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<version>${version.javax.enterprise}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
9 changes: 7 additions & 2 deletions integrationtest/server-provisioning.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1" extract-schemas="true" copy-module-artifacts="true">
<feature-packs>

<feature-pack
Expand All @@ -9,7 +9,12 @@
<feature-pack
groupId="org.hibernate"
artifactId="hibernate-search-jbossmodules-orm"
version="${hibernateSearchVersion}" />
version="${version.org.hibernate.search}" />

<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-core"
version="${version.org.hibernate.ogm.core}" />

</feature-packs>
</server-provisioning>
10 changes: 9 additions & 1 deletion integrationtest/src/test/resources/arquillian.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
</protocol>
<configuration>
<property name="jbossHome">${jboss.home}</property>
<property name="javaVmArguments">-XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -XX:+IgnoreUnrecognizedVMOptions</property>
<property name="javaVmArguments">
-XX:MaxPermSize=512m
-Djava.net.preferIPv4Stack=true
-XX:+IgnoreUnrecognizedVMOptions
-Dee8.preview.mode=true
</property>
<!--
-Dremote.maven.repo=http://repository.jboss.org/nexus/content/groups/public/
-->
<!-- To debug the Arquillian managed application server: -->
<!-- <property name="javaVmArguments">-Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y -Xmx512m -XX:MaxPermSize=128m</property> -->
</configuration>
Expand Down
5 changes: 2 additions & 3 deletions integrationtest/src/test/resources/module-versions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#This is to let Maven properties be injected in the file, making it easier to run tests in the IDE as well
#hibernate-ogm.module.slot = ${hibernate.ogm.module.slot} #This one requires specific handling, see org.hibernate.ogm.test.integration.testcase.util.ModulesHelper.getModuleSlotString()
hibernate-search.module.slot = ${hibernate-search.module.slot}
dependency.version.HibernateOgm = ${project.version}
hibernate-search.module.slot = ${version.org.hibernate.search}
dependency.version.HibernateOgm = ${version.org.hibernate.ogm.core}
igniteVersion = ${igniteVersion}
6 changes: 2 additions & 4 deletions modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -22,9 +22,7 @@
<properties>
<module.xml.basedir>${basedir}/src/main/modules</module.xml.basedir>
<module.xml.aliases.basedir>${basedir}/src/main/aliases</module.xml.aliases.basedir>
<hibernate.ogm.module.slot>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</hibernate.ogm.module.slot>
<hibernate.ogm.ignite.module.slot>${hibernate.ogm.module.slot}</hibernate.ogm.ignite.module.slot>
<hibernate.hql.module.slot>${hibernateHqlParserVersion}</hibernate.hql.module.slot>
<hibernate.ogm.ignite.module.slot>${module-slot.org.hibernate.ogm.short-id}</hibernate.ogm.ignite.module.slot>
<org.apache.ignite.module.slot>${igniteVersion}</org.apache.ignite.module.slot>
<javax.cache.module.slot>${cacheApiVersion}</javax.cache.module.slot>
<com.h2database.h2.module.slot>${h2Version}</com.h2database.h2.module.slot>
Expand Down
4 changes: 2 additions & 2 deletions modules/src/main/modules/ignite/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<resource-root path="ignite-jta-${org.apache.ignite.module.slot}.jar" />
</resources>
<dependencies>
<module name="org.hibernate.ogm" slot="${hibernate.ogm.module.slot}" />
<module name="org.hibernate.hql" slot="${hibernate.hql.module.slot}" />
<module name="org.hibernate.ogm" slot="${module-slot.org.hibernate.ogm.short-id}" />
<module name="org.hibernate.hql" slot="${module-slot.org.hibernate.hql.full-id}" />

<module name="javax.persistence.api" />
<module name="javax.transaction.api" />
Expand Down
4 changes: 2 additions & 2 deletions modules/src/main/modules/ogm/ignite/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<resource-root path="hibernate-ogm-ignite-${project.version}.jar" />
</resources>
<dependencies>
<module name="org.hibernate.ogm" slot="${hibernate.ogm.module.slot}" />
<module name="org.hibernate.hql" slot="${hibernate.hql.module.slot}" />
<module name="org.hibernate.ogm" slot="${module-slot.org.hibernate.ogm.short-id}" />
<module name="org.hibernate.hql" slot="${module-slot.org.hibernate.hql.full-id}" />

<module name="javax.persistence.api" />
<module name="javax.transaction.api" />
Expand Down
8 changes: 6 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@
<parent>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-parent</artifactId>
<version>5.3.0-SNAPSHOT</version>
<version>5.4.0.Final</version>
</parent>

<artifactId>hibernate-ogm-ignite-parent</artifactId>
<version>5.4.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Hibernate OGM Contrib Aggregator</name>
<description>Hibernate OGM Contrib Aggregator POM</description>

<properties>
<version.org.hibernate.ogm.core>5.4.0.Final</version.org.hibernate.ogm.core>
<hibernateWildflyClassifier>wildfly-13-dist</hibernateWildflyClassifier>
<!-- Ignite -->
<igniteVersion>2.4.0</igniteVersion>
<igniteVersion>2.6.0</igniteVersion>
<h2Version>1.4.195</h2Version>
<cacheApiVersion>1.0.0</cacheApiVersion>
</properties>
Expand All @@ -31,6 +34,7 @@
<module>ignite</module>
</modules>


<!-- Only for management of test-scoped dependencies; All other dependencies (which are exposed to users) are
managed in the BOM -->
<dependencyManagement>
Expand Down