From ae4bca3a4e4462c14906aba5f17c1b309d4453e0 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Tue, 4 Jun 2024 10:53:46 +0200 Subject: [PATCH] [#1930] Update Hibernate ORM to 6.6.0.Alpha1 --- README.md | 2 +- build.gradle | 2 +- gradle.properties | 8 +++---- .../ReactiveToOneAttributeMapping.java | 6 +++-- ...ReactiveEntityDelayedFetchInitializer.java | 6 +++-- .../ReactiveEntityDelayedFetchImpl.java | 24 +++++++++++-------- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 751bd21e21..172f7adb04 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Hibernate Reactive has been tested with: - CockroachDB v24 - MS SQL Server 2022 - Oracle 23 -- [Hibernate ORM][] 6.5.2.Final +- [Hibernate ORM][] 6.6.0.Alpha1 - [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.7 - [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.7 - [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.7 diff --git a/build.gradle b/build.gradle index fdecb377bc..810f70098e 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ version = projectVersion // ./gradlew clean build -PhibernateOrmVersion=5.6.15-SNAPSHOT ext { if ( !project.hasProperty('hibernateOrmVersion') ) { - hibernateOrmVersion = '6.5.2.Final' + hibernateOrmVersion = '6.6.0.Alpha1' } if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) { // Same as ORM as default diff --git a/gradle.properties b/gradle.properties index a49aef66a8..f0ea811b34 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,22 +29,22 @@ org.gradle.java.installations.auto-download=false #db = MSSQL # Enable the SonatypeOS maven repository (mainly for Vert.x snapshots) when present (value ignored) -enableSonatypeOpenSourceSnapshotsRep = true +#enableSonatypeOpenSourceSnapshotsRep = true # Enable the maven local repository (for local development when needed) when present (value ignored) #enableMavenLocalRepo = true # Override default Hibernate ORM version -hibernateOrmVersion = [6.4,6.6) +#hibernateOrmVersion = 6.6.0.Alpha1 # Override default Hibernate ORM Gradle plugin version # Using the stable version because I don't know how to configure the build to download the snapshot version from # a remote repository -#hibernateOrmGradlePluginVersion = 6.5.2.Final +#hibernateOrmGradlePluginVersion = 6.6.0.Alpha1 # If set to true, skip Hibernate ORM version parsing (default is true, if set to null) # this is required when using intervals or weird versions or the build will fail -skipOrmVersionParsing = true +#skipOrmVersionParsing = true # Override default Vert.x Sql client version #vertxSqlClientVersion = 4.5.7-SNAPSHOT diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java index 3acdff04ca..e2d73f7f74 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/metamodel/mapping/internal/ReactiveToOneAttributeMapping.java @@ -81,13 +81,15 @@ protected EntityFetch buildEntityDelayedFetch( ToOneAttributeMapping fetchedAttribute, NavigablePath navigablePath, DomainResult keyResult, - boolean selectByUniqueKey) { + boolean selectByUniqueKey, + DomainResultCreationState creationState) { return new ReactiveEntityDelayedFetchImpl( fetchParent, fetchedAttribute, navigablePath, keyResult, - selectByUniqueKey + selectByUniqueKey, + creationState ); } diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/graph/entity/internal/ReactiveEntityDelayedFetchInitializer.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/graph/entity/internal/ReactiveEntityDelayedFetchInitializer.java index e761ce183d..05476c3251 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/graph/entity/internal/ReactiveEntityDelayedFetchInitializer.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/graph/entity/internal/ReactiveEntityDelayedFetchInitializer.java @@ -24,6 +24,7 @@ import org.hibernate.spi.NavigablePath; import org.hibernate.sql.results.graph.DomainResultAssembler; import org.hibernate.sql.results.graph.FetchParentAccess; +import org.hibernate.sql.results.graph.basic.BasicResultAssembler; import org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchInitializer; import org.hibernate.type.Type; @@ -38,8 +39,9 @@ public ReactiveEntityDelayedFetchInitializer( NavigablePath fetchedNavigable, ToOneAttributeMapping referencedModelPart, boolean selectByUniqueKey, - DomainResultAssembler identifierAssembler) { - super( parentAccess, fetchedNavigable, referencedModelPart, selectByUniqueKey, identifierAssembler ); + DomainResultAssembler identifierAssembler, + BasicResultAssembler discriminatorAssembler) { + super( parentAccess, fetchedNavigable, referencedModelPart, selectByUniqueKey, identifierAssembler, discriminatorAssembler ); this.referencedModelPart = referencedModelPart; } diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveEntityDelayedFetchImpl.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveEntityDelayedFetchImpl.java index 5fc1a50b7f..f4a121895b 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveEntityDelayedFetchImpl.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveEntityDelayedFetchImpl.java @@ -10,8 +10,10 @@ import org.hibernate.spi.NavigablePath; import org.hibernate.sql.results.graph.AssemblerCreationState; import org.hibernate.sql.results.graph.DomainResult; +import org.hibernate.sql.results.graph.DomainResultCreationState; import org.hibernate.sql.results.graph.FetchParent; import org.hibernate.sql.results.graph.FetchParentAccess; +import org.hibernate.sql.results.graph.basic.BasicResultAssembler; import org.hibernate.sql.results.graph.entity.EntityInitializer; import org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchImpl; @@ -21,20 +23,22 @@ public ReactiveEntityDelayedFetchImpl( ToOneAttributeMapping fetchedAttribute, NavigablePath navigablePath, DomainResult keyResult, - boolean selectByUniqueKey) { - super( fetchParent, fetchedAttribute, navigablePath, keyResult, selectByUniqueKey ); + boolean selectByUniqueKey, + DomainResultCreationState creationState) { + super( fetchParent, fetchedAttribute, navigablePath, keyResult, selectByUniqueKey, creationState ); } @Override public EntityInitializer createInitializer(FetchParentAccess parentAccess, AssemblerCreationState creationState) { - return new ReactiveEntityDelayedFetchInitializer( parentAccess, - getNavigablePath(), - getEntityValuedModelPart(), - isSelectByUniqueKey(), - getKeyResult().createResultAssembler( - parentAccess, - creationState - ) + return new ReactiveEntityDelayedFetchInitializer( + parentAccess, + getNavigablePath(), + getEntityValuedModelPart(), + isSelectByUniqueKey(), + getKeyResult().createResultAssembler( parentAccess, creationState ), + getDiscriminatorFetch() != null + ? (BasicResultAssembler) getDiscriminatorFetch().createResultAssembler( parentAccess, creationState ) + : null ); } }