Skip to content

Commit 6ccdf1b

Browse files
committed
[#2259] Upgrade Hibernate ORM to 7.0.0.Final
- Replace getJpaMetamodel() with getSessionFactoryOptions()
1 parent d7f9ed9 commit 6ccdf1b

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Hibernate Reactive has been tested with:
3838
- CockroachDB v24
3939
- MS SQL Server 2022
4040
- Oracle 23
41-
- [Hibernate ORM][] 7.0.0.CR1
41+
- [Hibernate ORM][] 7.0.0.Final
4242
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.14
4343
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.14
4444
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.14

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ org.gradle.java.installations.auto-download=false
3535
#enableMavenLocalRepo = true
3636

3737
# The default Hibernate ORM version (override using `-PhibernateOrmVersion=the.version.you.want`)
38-
hibernateOrmVersion = 7.0.0.CR2
38+
hibernateOrmVersion = 7.0.0.Final
3939

4040
# Override default Hibernate ORM Gradle plugin version
4141
# Using the stable version because I don't know how to configure the build to download the snapshot version from
4242
# a remote repository
43-
#hibernateOrmGradlePluginVersion = 7.0.0.CR1
43+
#hibernateOrmGradlePluginVersion = 7.0.0.Final
4444

4545
# If set to true, skip Hibernate ORM version parsing (default is true, if set to null)
4646
# this is required when using intervals or weird versions or the build will fail

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveAbstractMultiIdEntityLoader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,7 @@ public final <K> CompletionStage<List<T>> reactiveLoad(K[] ids, MultiIdLoadOptio
6262

6363
protected abstract <K> CompletionStage<List<T>> performUnorderedMultiLoad(K[] ids, MultiIdLoadOptions loadOptions, SharedSessionContractImplementor session);
6464

65+
protected boolean isIdCoercionEnabled() {
66+
return !getSessionFactory().getSessionFactoryOptions().getJpaCompliance().isLoadByIdComplianceEnabled();
67+
}
6568
}

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected <K> CompletionStage<List<E>> performOrderedMultiLoad(
9090
);
9191
}
9292

93-
final boolean coerce = !getSessionFactory().getJpaMetamodel().getJpaCompliance().isLoadByIdComplianceEnabled();
93+
final boolean coerce = isIdCoercionEnabled();
9494
final LockOptions lockOptions = ( loadOptions.getLockOptions() == null )
9595
? new LockOptions( LockMode.NONE )
9696
: loadOptions.getLockOptions();
@@ -312,7 +312,7 @@ protected final <R, K> K[] processResolvableEntities(
312312
return ids;
313313
}
314314

315-
final boolean coerce = !getSessionFactory().getJpaMetamodel().getJpaCompliance().isLoadByIdComplianceEnabled();
315+
final boolean coerce = isIdCoercionEnabled();
316316

317317
boolean foundAnyResolvedEntities = false;
318318
List<K> nonResolvedIds = null;

hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderStandard.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected CompletionStage<List<T>> performOrderedMultiLoad(
103103
final List<Object> idsInBatch = new ArrayList<>();
104104
final List<Integer> elementPositionsLoadedByBatch = new ArrayList<>();
105105

106-
final boolean coerce = !getSessionFactory().getJpaMetamodel().getJpaCompliance().isLoadByIdComplianceEnabled();
106+
final boolean coerce = isIdCoercionEnabled();
107107
return loop( 0, ids.length, i -> {
108108
final Object id = coerce
109109
? getEntityDescriptor().getIdentifierMapping().getJavaType().coerce( ids[i], session )
@@ -311,7 +311,7 @@ protected CompletionStage<List<T>> performUnorderedMultiLoad(
311311
boolean foundAnyManagedEntities = false;
312312
final List<Object> nonManagedIds = new ArrayList<>();
313313

314-
final boolean coerce = !getSessionFactory().getJpaMetamodel().getJpaCompliance().isLoadByIdComplianceEnabled();
314+
final boolean coerce = isIdCoercionEnabled();
315315
for ( Object o : ids ) {
316316
final Object id = coerce
317317
? getEntityDescriptor().getIdentifierMapping().getJavaType().coerce( o, session )

hibernate-reactive-core/src/main/java/org/hibernate/reactive/session/impl/ReactiveSessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ public <R> ReactiveQuery<R> createReactiveQuery(CriteriaQuery<R> criteriaQuery)
382382
return createReactiveCriteriaQuery( selectStatement, criteriaQuery.getResultType() );
383383
}
384384
catch (RuntimeException e) {
385-
if ( getSessionFactory().getJpaMetamodel().getJpaCompliance().isJpaTransactionComplianceEnabled() ) {
385+
if ( getSessionFactory().getSessionFactoryOptions().getJpaCompliance().isJpaTransactionComplianceEnabled() ) {
386386
markForRollbackOnly();
387387
}
388388
throw getExceptionConverter().convert( e );

hibernate-reactive-core/src/main/java/org/hibernate/reactive/session/impl/ReactiveStatelessSessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ public <R> ReactiveQuery<R> createReactiveQuery(CriteriaQuery<R> criteriaQuery)
979979
return createReactiveCriteriaQuery( selectStatement, criteriaQuery.getResultType() );
980980
}
981981
catch (RuntimeException e) {
982-
if ( getSessionFactory().getJpaMetamodel().getJpaCompliance().isJpaTransactionComplianceEnabled() ) {
982+
if ( getSessionFactory().getSessionFactoryOptions().getJpaCompliance().isJpaTransactionComplianceEnabled() ) {
983983
markForRollbackOnly();
984984
}
985985
throw getExceptionConverter().convert( e );

0 commit comments

Comments
 (0)