Skip to content

Commit

Permalink
HSEARCH-4791 Upgrade to Hibernate ORM 6.2.0.CR2
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere authored and marko-bekhta committed Sep 25, 2023
1 parent 820bd25 commit db557e2
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 53 deletions.
14 changes: 14 additions & 0 deletions build/configuration-properties-collector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</dependency>

<!-- This dependency is only here to solve javadoc warnings.
For some reason, if we rely on the transitive dependency from mapper-orm,
we end up with warnings like this:
class file for jakarta.xml.bind.annotation.XmlAccessType not found
Who knows what the exact reason is.
-->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.xml.bind}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
<artifactId>${jdbc.driver.artifactId}</artifactId>
<scope>test</scope>
</dependency>
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
https://github.com/jakartaee/transactions/pull/212 -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.enterprise}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions integrationtest/java/modules/orm-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
<artifactId>${jdbc.driver.artifactId}</artifactId>
<scope>test</scope>
</dependency>
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
https://github.com/jakartaee/transactions/pull/212 -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.enterprise}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
9 changes: 9 additions & 0 deletions integrationtest/java/modules/orm-lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
<artifactId>${jdbc.driver.artifactId}</artifactId>
<scope>test</scope>
</dependency>
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
https://github.com/jakartaee/transactions/pull/212 -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.enterprise}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import org.hibernate.Hibernate;
import org.hibernate.SessionFactory;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
Expand Down Expand Up @@ -139,7 +137,8 @@ public static class Group {
private int someInteger;

@OneToMany(mappedBy = "group")
@LazyCollection(LazyCollectionOption.EXTRA)
@SuppressWarnings("deprecation")
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
private Set<Post> posts = new HashSet<>();

public Integer getId() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import jakarta.persistence.OrderColumn;
import jakarta.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
import org.hibernate.search.util.impl.integrationtest.common.rule.BackendMock;
Expand Down Expand Up @@ -131,7 +129,8 @@ public static class Post {
private String name;

@OneToMany(mappedBy = "post", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@LazyCollection(LazyCollectionOption.EXTRA)
@SuppressWarnings("deprecation")
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
@OrderColumn(name = "idx")
private List<Comment> comments = new ArrayList<>();

Expand Down
27 changes: 27 additions & 0 deletions mapper/orm-batch-jsr352/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,33 @@
<artifactId>jakarta.batch-api</artifactId>
</dependency>

<!-- This dependency is only here to solve Moditect errors.
For some reason, the jakarta.transaction module requires jakarta.interceptor,
but the jakarta.transaction-api Maven module doesn't depend on jakarta.interceptor-api,
and that doesn't play well with Moditect, which ends up throwing an exception:
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
-->
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.interceptor-api}</version>
<scope>provided</scope>
</dependency>
<!-- This dependency is only here to solve Moditect errors.
For some reason, the jakarta.transaction module requires jakarta.cdi,
but the jakarta.transaction-api Maven module doesn't depend on jakarta.enterprise.cdi-api,
and that doesn't play well with Moditect, which ends up throwing an exception:
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
-->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.enterprise}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-test-orm</artifactId>
Expand Down
15 changes: 0 additions & 15 deletions mapper/orm-batch-jsr352/jberet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
</dependency>

<!-- This dependency is only here to solve javadoc warnings.
For some reason, if we rely on the transitive dependency from mapper-orm,
we end up with javadoc warnings like this:
unknown enum constant XmlAccessType.FIELD
This seems related to the annotation processor,
but who knows what the exact reason is.
-->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.xml.bind}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
45 changes: 29 additions & 16 deletions mapper/orm-coordination-outbox-polling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-orm</artifactId>
</dependency>
<!-- This dependency is only here to solve compilation warnings.
For some reason, if we rely on the transitive dependency from mapper-orm,
we end up with compilation warnings like this:
unknown enum constant XmlAccessType.FIELD
This seems related to the annotation processor,
but who knows what the exact reason is.
-->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.xml.bind}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
Expand All @@ -51,8 +37,8 @@
</dependency>

<!-- We only depend on Jackson indirectly through Avro,
but Dependabot apparently ignores dependency management,
so we need these explicit dependencies to have Dependabot update versions. -->
but Dependabot apparently ignores dependency management,
so we need these explicit dependencies to have Dependabot update versions. -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand All @@ -66,6 +52,33 @@
<artifactId>jackson-annotations</artifactId>
</dependency>

<!-- This dependency is only here to solve Moditect errors.
For some reason, the jakarta.transaction module requires jakarta.interceptor,
but the jakarta.transaction-api Maven module doesn't depend on jakarta.interceptor-api,
and that doesn't play well with Moditect, which ends up throwing an exception:
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
-->
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.interceptor-api}</version>
<scope>provided</scope>
</dependency>
<!-- This dependency is only here to solve Moditect errors.
For some reason, the jakarta.transaction module requires jakarta.cdi,
but the jakarta.transaction-api Maven module doesn't depend on jakarta.enterprise.cdi-api,
and that doesn't play well with Moditect, which ends up throwing an exception:
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
-->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.jakarta.enterprise}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-test-orm</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class OutboxEventLoader implements ToStringTreeAppendable {
// so we can afford to just skip events that are already locked,
// and process them later when they are no longer locked.
if ( dialect.supportsSkipLocked() ) {
lockOptions = new LockOptions( LockMode.PESSIMISTIC_WRITE ).setTimeOut( LockOptions.SKIP_LOCKED );
lockOptions = new LockOptions( LockMode.UPGRADE_SKIPLOCKED );
}
// If SKIP_LOCKED is not supported, we just do basic locking and hope for the best
// (in particular we hope for transaction deadlocks to be detected by the database and result in a failure,
Expand Down
6 changes: 6 additions & 0 deletions mapper/orm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.org.hibernate.commons.annotations}</version>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
<version>${version.io.smallrye.jandex}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ private UnsupportedOperationException parametersNoSupported() {
}

@Override
public QueryImplementor<R> setTupleTransformer(TupleTransformer transformer) {
public <T> QueryImplementor<T> setTupleTransformer(TupleTransformer<T> transformer) {
throw resultOrTupleTransformerNotImplemented();
}

@Override
public QueryImplementor<R> setResultListTransformer(ResultListTransformer resultListTransformer) {
public QueryImplementor<R> setResultListTransformer(ResultListTransformer<R> resultListTransformer) {
throw resultOrTupleTransformerNotImplemented();
}

Expand Down
19 changes: 6 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,10 @@
<version.org.jboss.jandex>2.4.2.Final</version.org.jboss.jandex>
<version.org.hibernate.commons.annotations>${version.org.hibernate.commons.annotations.orm6}</version.org.hibernate.commons.annotations>
<version.net.bytebuddy>${version.net.bytebuddy.orm6}</version.net.bytebuddy>
<version.io.smallrye.jandex>3.0.0</version.io.smallrye.jandex>

<!-- >>> ORM 6 with Jakarta Persistence -->
<version.org.hibernate.orm>6.1.6.Final</version.org.hibernate.orm>
<version.org.hibernate.orm>6.2.0.CR2</version.org.hibernate.orm>
<javadoc.org.hibernate.orm.url>https://docs.jboss.org/hibernate/orm/${parsed-version.org.hibernate.orm.majorVersion}.${parsed-version.org.hibernate.orm.minorVersion}/javadocs/</javadoc.org.hibernate.orm.url>
<documentation.org.hibernate.orm.url>https://docs.jboss.org/hibernate/orm/${parsed-version.org.hibernate.orm.majorVersion}.${parsed-version.org.hibernate.orm.minorVersion}/userguide/html_single/Hibernate_User_Guide.html</documentation.org.hibernate.orm.url>
<!-- These version must be kept in sync with the version of the dependency in Hibernate ORM 6.
Expand All @@ -273,12 +274,12 @@
-->
<version.io.smallrye.jandex>3.0.5</version.io.smallrye.jandex>
<version.org.hibernate.commons.annotations.orm6>6.0.5.Final</version.org.hibernate.commons.annotations.orm6>
<version.jakarta.persistence>3.0.0</version.jakarta.persistence>
<version.jakarta.transaction-api>2.0.0</version.jakarta.transaction-api>
<version.jakarta.persistence>3.1.0</version.jakarta.persistence>
<version.jakarta.transaction-api>2.0.1</version.jakarta.transaction-api>
<version.jakarta.interceptor-api>2.0.1</version.jakarta.interceptor-api>
<version.jakarta.enterprise>3.0.1</version.jakarta.enterprise>
<version.jakarta.xml.bind>3.0.1</version.jakarta.xml.bind>
<version.net.bytebuddy.orm6>1.12.9</version.net.bytebuddy.orm6>
<version.jakarta.xml.bind>4.0.0</version.jakarta.xml.bind>
<version.net.bytebuddy.orm6>1.12.18</version.net.bytebuddy.orm6>

<!-- >>> JSR 352 -->
<version.jakarta.batch>2.1.1</version.jakarta.batch>
Expand Down Expand Up @@ -887,14 +888,6 @@
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>${version.org.hibernate.orm}</version>
<exclusions>
<!-- hibernate-core already depends on jakarta.xml.bind-api,
which depends on com.sun.activation, which bundles the activation API already -->
<exclusion>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
Expand Down

0 comments on commit db557e2

Please sign in to comment.