Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Hibernate ORM to 6.6.0.CR2 #1969

Merged
merged 6 commits into from
Aug 6, 2024
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Learn more at <http://hibernate.org/reactive>.

Hibernate Reactive has been tested with:

- Java 11, 17, 20, 21
- Java 11, 17, 20, 21, 22
- PostgreSQL 16
- MySQL 8
- MariaDB 11
- Db2 11
- CockroachDB v24
- MS SQL Server 2022
- Oracle 23
- [Hibernate ORM][] 6.5.2.Final
- [Hibernate ORM][] 6.6.0.CR2
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.9
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.9
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.9
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.CR2'
}
if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) {
// Same as ORM as default
Expand Down
5 changes: 5 additions & 0 deletions examples/native-sql-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/session-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
projectVersion=2.3.2-SNAPSHOT
projectVersion=2.4.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,8 @@ public CompletionStage<Void> addAction(ReactiveEntityInsertAction action) {
return addInsertAction( action );
}

private CompletionStage<Void> addInsertAction( ReactiveEntityInsertAction insert) {
CompletionStage<Void> ret = voidFuture();
if ( insert.isEarlyInsert() ) {
// For early inserts, must execute inserts before finding non-nullable transient entities.
// TODO: find out why this is necessary
LOG.tracev( "Executing inserts before finding non-nullable transient entities for early insert: [{0}]", insert );
ret = ret.thenCompose( v -> executeInserts() );
}

return ret
private CompletionStage<Void> addInsertAction(ReactiveEntityInsertAction insert) {
return executeEarlyInsertsIfRequired( insert )
.thenCompose( v -> insert.reactiveFindNonNullableTransientEntities() )
.thenCompose( nonNullables -> {
if ( nonNullables == null ) {
Expand All @@ -270,40 +262,51 @@ private CompletionStage<Void> addInsertAction( ReactiveEntityInsertAction insert
} );
}

private CompletionStage<Void> executeEarlyInsertsIfRequired(ReactiveEntityInsertAction insert) {
if ( insert.isEarlyInsert() ) {
// For early inserts, must execute inserts before finding non-nullable transient entities.
// TODO: find out why this is necessary
LOG.tracev(
"Executing inserts before finding non-nullable transient entities for early insert: [{0}]",
insert
);
return executeInserts();
}
return voidFuture();
}

private CompletionStage<Void> addResolvedEntityInsertAction(ReactiveEntityInsertAction insert) {
CompletionStage<Void> ret;
if ( insert.isEarlyInsert() ) {
LOG.trace( "Executing insertions before resolved early-insert" );
ret = executeInserts()
.thenCompose( v -> {
// For early inserts, must execute inserts before finding non-nullable transient entities.
LOG.tracev( "Executing inserts before finding non-nullable transient entities for early insert: [{0}]", insert );
return executeInserts().thenCompose( v -> {
LOG.debug( "Executing identity-insert immediately" );
return execute( insert );
} );
} )
.thenCompose( v -> postResolvedEntityInsertAction( insert ) );
}
else {
LOG.trace( "Adding resolved non-early insert action." );
OrderedActions.EntityInsertAction.ensureInitialized( this );
this.insertions.add( new ReactiveEntityInsertActionHolder( insert ) );
ret = voidFuture();
return postResolvedEntityInsertAction( insert );
}
}

return ret.thenCompose( v -> {
if ( !insert.isVeto() ) {
CompletionStage<Void> comp = insert.reactiveMakeEntityManaged();
if ( unresolvedInsertions == null ) {
return comp;
}
else {
return comp.thenCompose( vv -> loop(
private CompletionStage<Void> postResolvedEntityInsertAction(ReactiveEntityInsertAction insert) {
if ( !insert.isVeto() ) {
return insert.reactiveMakeEntityManaged().thenCompose( v -> {
if ( unresolvedInsertions != null ) {
return loop(
unresolvedInsertions.resolveDependentActions( insert.getInstance(), session.getSharedContract() ),
resolvedAction -> addResolvedEntityInsertAction( (ReactiveEntityRegularInsertAction) resolvedAction )
) );
);
}
}
else {
throw new ReactiveEntityActionVetoException( "The ReactiveEntityInsertAction was vetoed.", insert );
}
} );
return voidFuture();
} );
}

throw new ReactiveEntityActionVetoException( "The ReactiveEntityInsertAction was vetoed.", insert );
}

private static String[] convertTimestampSpaces(Serializable[] spaces) {
Expand Down
Loading
Loading