diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8f519dac8..2718f729f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -50,7 +50,7 @@ jobs:
# Label used to access the service container
mysql:
# Docker Hub image
- image: mysql:8.4.0
+ image: mysql:9.2.0
env:
MYSQL_ROOT_PASSWORD: hreact
MYSQL_DATABASE: hreact
@@ -66,7 +66,7 @@ jobs:
- 3306:3306
postgres:
# Docker Hub image
- image: postgres:16.3
+ image: postgres:17.4
env:
POSTGRES_DB: hreact
POSTGRES_USER: hreact
@@ -90,7 +90,7 @@ jobs:
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Gradle downloads
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: cache-gradle
with:
path: |
@@ -116,7 +116,7 @@ jobs:
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
- name: Upload reports (if build failed)
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: reports-examples-${{ matrix.db }}
@@ -139,7 +139,7 @@ jobs:
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Gradle downloads
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: cache-gradle
with:
path: |
@@ -166,7 +166,7 @@ jobs:
- name: Build and Test with ${{ matrix.db }}
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
- name: Upload reports (if build failed)
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: reports-db-${{ matrix.db }}
@@ -191,8 +191,7 @@ jobs:
# and it's useful to test that.
- { name: "20", java_version_numeric: 20, jvm_args: '--enable-preview' }
- { name: "21", java_version_numeric: 21, jvm_args: '--enable-preview' }
- - { name: "23", java_version_numeric: 23, from: 'jdk.java.net', jvm_args: '--enable-preview' }
- - { name: "24-ea", java_version_numeric: 24, from: 'jdk.java.net', jvm_args: '--enable-preview' }
+ - { name: "24", java_version_numeric: 24, from: 'jdk.java.net', jvm_args: '--enable-preview' }
- { name: "25-ea", java_version_numeric: 25, from: 'jdk.java.net', jvm_args: '--enable-preview' }
steps:
- name: Checkout ${{ inputs.branch }}
@@ -217,7 +216,7 @@ jobs:
echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT
- name: Cache Maven/Gradle Dependency/Dist Caches
id: cache-maven
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
# if it's not a pull request, we restore and save the cache
if: github.event_name != 'pull_request'
with:
@@ -234,7 +233,7 @@ jobs:
${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}-
${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}-
- name: Restore Maven/Gradle Dependency/Dist Caches
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
+ uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
# if it's a pull request, we restore the cache, but we don't save it
if: github.event_name == 'pull_request'
with:
@@ -292,7 +291,7 @@ jobs:
-Porg.gradle.java.installations.paths=${{ steps.mainjdk-exportpath.outputs.path }},${{ steps.testjdk-exportpath.outputs.path }} \
${{ matrix.java.jvm_args && '-Ptest.jdk.launcher.args=' }}${{ matrix.java.jvm_args }}
- name: Upload reports (if build failed)
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: reports-java${{ matrix.java.name }}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..2df00b224
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,107 @@
+# Contributing
+
+Contributions from the community are essential in keeping Hibernate (and any Open Source
+project really) strong and successful.
+
+# Legal
+
+All original contributions to Hibernate are licensed under the
+[Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).
+
+The Apache 2.0 license text is included verbatim in the [LICENSE](LICENSE) file in the root directory
+of the Hibernate Reactive repository.
+
+All contributions are subject to the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
+
+The DCO text is available verbatim in the [dco.txt](dco.txt) file in the root directory
+of the Hibernate Reactive repository.
+
+## Guidelines
+
+While we try to keep requirements for contributing to a minimum, there are a few guidelines
+we ask that you mind.
+
+For code contributions, these guidelines include:
+* Respect the project code style - find templates for [IntelliJ IDEA](https://hibernate.org/community/contribute/intellij-idea/) or [Eclipse](https://hibernate.org/community/contribute/eclipse-ide/)
+* Have a corresponding GitHub [issue](https://github.com/hibernate/hibernate-reactive/issues) and be sure to include
+ the key for this issue in your commit messages.
+* Have a set of appropriate tests.
+ For your convenience, a [set of test templates](https://github.com/hibernate/hibernate-test-case-templates/tree/main/reactive)
+ have been made available.
+
+ When submitting bug reports, the tests should reproduce the initially reported bug and illustrate that your solution addresses the issue.
+ For features/enhancements, the tests should demonstrate that the feature works as intended.
+ In both cases, be sure to incorporate your tests into the project to protect against possible regressions.
+* If applicable, documentation should be updated to reflect the introduced changes
+* The code compiles and the tests pass (`./gradlew clean build`)
+
+For documentation contributions, mainly to respect the project code style, especially in regard
+to the use of tabs - as mentioned above, code style templates are available for both IntelliJ IDEA and Eclipse
+IDEs. Ideally, these contributions would also have a corresponding issue, although this
+is less necessary for documentation contributions.
+
+## Getting Started
+
+If you are just getting started with Git, GitHub, and/or contributing to Hibernate via
+GitHub there are a few pre-requisite steps to follow:
+
+* Make sure you have a [GitHub account](https://github.com/signup/free)
+* [Fork](https://help.github.com/articles/fork-a-repo) the Hibernate Reactive repository. As discussed in
+the linked page, this also includes:
+ * [set up your local git install](https://help.github.com/articles/set-up-git)
+ * clone your fork
+* Instruct git to ignore certain commits when using `git blame`. From the directory of your local clone, run this: `git config blame.ignoreRevsFile .git-blame-ignore-revs`
+* See the wiki pages for setting up your IDE, whether you use
+[IntelliJ IDEA](https://hibernate.org/community/contribute/intellij-idea/)
+or [Eclipse](https://hibernate.org/community/contribute/eclipse-ide/)(1).
+
+
+## Create the working (topic) branch
+
+Create a [topic branch](https://git-scm.com/book/en/Git-Branching-Branching-Workflows#Topic-Branches)
+on which you will work. The convention is to incorporate the JIRA issue key in the name of this branch,
+although this is more of a mnemonic strategy than a hard-and-fast rule - but doing so helps:
+* Remember what each branch is for
+* Isolate the work from other contributions you may be working on
+
+_If there is not already a GitHub issue covering the work you want to do, [create one](https://github.com/hibernate/hibernate-reactive/issues/new)._
+
+Assuming you will be working from the `main` branch and working
+on the GitHub issue #123 : `git checkout -b 123 main`
+
+## Code
+
+Do your thing!
+
+
+## Commit
+
+* Make commits of logical units
+* Be sure to start each commit message using the ** GitHub issue key **. For example:
+ ```
+ [#1234] Fix some kind of problem
+ ```
+* Make sure you have added the necessary tests for your changes
+* Run _all_ the tests to ensure nothing else was accidentally broken
+
+_Before committing, if you want to pull in the latest upstream changes (highly
+appreciated btw), please use rebasing rather than merging. Merging creates
+"merge commits" that invariably muck up the project timeline._
+
+## Submit
+
+* Push your changes to the topic branch in your fork of the repository
+* Initiate a [pull request](https://help.github.com/articles/creating-a-pull-request)
+* Adding the sentence `Fix #123`, where `#123` is the issue key, will link the pull request to the corresponding issue
+ and close it accordingly, when the pull request gets merged.
+
+It is important that this topic branch of your fork:
+
+* Is isolated to just the work on this one issue, or multiple issues if they are
+ related and also fixed/implemented by this work. The main point is to not push commits for more than
+ one PR to a single branch - GitHub PRs are linked to a branch rather than specific commits
+* remain until the PR is closed. Once the underlying branch is deleted the corresponding PR will be closed,
+ if not already, and the changes will be lost.
+
+# Notes
+(1) Gradle `eclipse` plugin is no longer supported, so the recommended way to import the project in your IDE is with the proper IDE tools/plugins. Don't try to run `./gradlew clean eclipse --refresh-dependencies` from the command line as you'll get an error because `eclipse` no longer exists
diff --git a/README.md b/README.md
index 746235200..c01979d65 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,11 @@
[](https://hibernate.org/reactive)
-[](https://github.com/hibernate/hibernate-reactive/actions?query=workflow%3A%22Hibernate+Reactive+CI%22)
-[](https://opensource.org/licenses/Apache-2.0)
-[](https://search.maven.org/search?q=g:org.hibernate.reactive)
-[](https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev)
-[](https://hibernate.org/reactive/documentation/)
+[](https://github.com/hibernate/hibernate-reactive/actions?query=workflow%3A%22Hibernate+Reactive+CI%22)
+[](https://opensource.org/licenses/Apache-2.0)
+[](https://search.maven.org/search?q=g:org.hibernate.reactive)
+[](https://hibernate.zulipchat.com/#narrow/stream/205413-hibernate-reactive-dev)
+[](https://hibernate.org/reactive/documentation/)
+[](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/hibernate/reactive/hibernate-reactive/README.md)
# Hibernate Reactive
@@ -29,20 +30,20 @@ Learn more at .
Hibernate Reactive has been tested with:
-- Java 11, 17, 21, 23
+- Java 17, 21, 24
- PostgreSQL 16
-- MySQL 8
+- MySQL 9
- MariaDB 11
-- Db2 11
+- Db2 12
- CockroachDB v24
- MS SQL Server 2022
- Oracle 23
- [Hibernate ORM][] 7.0.0.Beta4
-- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.13
-- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.13
-- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.13
-- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.13
-- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.13
+- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.14
+- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.14
+- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.14
+- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.14
+- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.14
- [Quarkus][Quarkus] via the Hibernate Reactive extension
[PostgreSQL]: https://www.postgresql.org
diff --git a/build.gradle b/build.gradle
index aef4fcc26..c7ad6918c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -22,10 +22,10 @@ ext {
// Example:
// ./gradlew build -PvertxSqlClientVersion=4.0.0-SNAPSHOT
if ( !project.hasProperty( 'vertxSqlClientVersion' ) ) {
- vertxSqlClientVersion = '4.5.13'
+ vertxSqlClientVersion = '4.5.14'
}
- testcontainersVersion = '1.20.4'
+ testcontainersVersion = '1.20.6'
logger.lifecycle "Vert.x SQL Client Version: " + project.vertxSqlClientVersion
}
diff --git a/gradle.properties b/gradle.properties
index 299ccf3b9..3576439d6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -35,7 +35,7 @@ org.gradle.java.installations.auto-download=false
#enableMavenLocalRepo = true
# The default Hibernate ORM version (override using `-PhibernateOrmVersion=the.version.you.want`)
-hibernateOrmVersion = 7.0.0.Beta4
+hibernateOrmVersion = 7.0.0.Beta5
# 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
@@ -47,9 +47,9 @@ hibernateOrmVersion = 7.0.0.Beta4
#skipOrmVersionParsing = true
# Override default Vert.x Sql client version
-#vertxSqlClientVersion = 4.5.13-SNAPSHOT
+#vertxSqlClientVersion = 4.5.14-SNAPSHOT
# Override default Vert.x Web client and server versions. For integration tests, both default to vertxSqlClientVersion
-#vertxWebVersion = 4.5.13
-#vertxWebtClientVersion = 4.5.13
+#vertxWebVersion = 4.5.14
+#vertxWebtClientVersion = 4.5.14
diff --git a/gradle/version.properties b/gradle/version.properties
index 08a599ec8..ebfc91836 100644
--- a/gradle/version.properties
+++ b/gradle/version.properties
@@ -1 +1 @@
-projectVersion=3.0.0.Beta2
\ No newline at end of file
+projectVersion=3.0.0.Beta3
\ No newline at end of file
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/ContextualDataStorage.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/ContextualDataStorage.java
new file mode 100644
index 000000000..295b92f4d
--- /dev/null
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/ContextualDataStorage.java
@@ -0,0 +1,25 @@
+/* Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * Copyright: Red Hat Inc. and Hibernate Authors
+ */
+package org.hibernate.reactive.context.impl;
+
+import java.util.concurrent.ConcurrentMap;
+
+import io.vertx.core.impl.VertxBuilder;
+import io.vertx.core.spi.VertxServiceProvider;
+import io.vertx.core.spi.context.storage.ContextLocal;
+
+/**
+ * SPI Implementation for {@link ContextLocal} storage.
+ */
+public class ContextualDataStorage implements VertxServiceProvider {
+
+ @SuppressWarnings("rawtypes")
+ static ContextLocal CONTEXTUAL_DATA_KEY = ContextLocal.registerLocal( ConcurrentMap.class );
+
+ @Override
+ public void init(VertxBuilder vertxBuilder) {
+ }
+}
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/VertxContext.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/VertxContext.java
index 4448c9b6c..937dc3b1b 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/VertxContext.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/context/impl/VertxContext.java
@@ -6,9 +6,12 @@
package org.hibernate.reactive.context.impl;
import java.lang.invoke.MethodHandles;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
import io.vertx.core.Vertx;
import io.vertx.core.impl.ContextInternal;
+import io.vertx.core.spi.context.storage.AccessMode;
import org.hibernate.reactive.context.Context;
import org.hibernate.reactive.logging.impl.Log;
@@ -36,10 +39,10 @@ public void injectServices(ServiceRegistryImplementor serviceRegistry) {
@Override
public void put(Key key, T instance) {
- final io.vertx.core.Context context = Vertx.currentContext();
+ final ContextInternal context = ContextInternal.current();
if ( context != null ) {
if ( trace ) LOG.tracef( "Putting key,value in context: [%1$s, %2$s]", key, instance );
- context.putLocal( key, instance );
+ VertxContext.contextualDataMap( context ).put( key, instance );
}
else {
if ( trace ) LOG.tracef( "Context is null for key,value: [%1$s, %2$s]", key, instance );
@@ -49,9 +52,9 @@ public void put(Key key, T instance) {
@Override
public T get(Key key) {
- final io.vertx.core.Context context = Vertx.currentContext();
+ final ContextInternal context = ContextInternal.current();
if ( context != null ) {
- T local = context.getLocal( key );
+ T local = VertxContext.contextualDataMap( context ).get( key );
if ( trace ) LOG.tracef( "Getting value %2$s from context for key %1$s", key, local );
return local;
}
@@ -63,9 +66,9 @@ public T get(Key key) {
@Override
public void remove(Key> key) {
- final io.vertx.core.Context context = Vertx.currentContext();
+ final ContextInternal context = ContextInternal.current();
if ( context != null ) {
- boolean removed = context.removeLocal( key );
+ boolean removed = contextualDataMap( context ).remove( key ) != null;
if ( trace ) LOG.tracef( "Key %s removed from context: %s", key, removed );
}
else {
@@ -92,4 +95,12 @@ public void execute(Runnable runnable) {
}
}
+ @SuppressWarnings({ "unchecked" })
+ private static ConcurrentMap, T> contextualDataMap(ContextInternal vertxContext) {
+ return vertxContext.getLocal(
+ ContextualDataStorage.CONTEXTUAL_DATA_KEY,
+ AccessMode.CONCURRENT,
+ ConcurrentHashMap::new
+ );
+ }
}
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java
index 4f1d62325..0a09ff3a1 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/engine/jdbc/mutation/internal/ReactiveMutationExecutorStandard.java
@@ -5,10 +5,6 @@
*/
package org.hibernate.reactive.engine.jdbc.mutation.internal;
-import java.lang.invoke.MethodHandles;
-import java.sql.SQLException;
-import java.util.concurrent.CompletionStage;
-
import org.hibernate.engine.jdbc.batch.spi.Batch;
import org.hibernate.engine.jdbc.mutation.JdbcValueBindings;
import org.hibernate.engine.jdbc.mutation.OperationResultChecker;
@@ -25,6 +21,7 @@
import org.hibernate.persister.entity.mutation.EntityTableMapping;
import org.hibernate.reactive.adaptor.impl.PrepareStatementDetailsAdaptor;
import org.hibernate.reactive.adaptor.impl.PreparedStatementAdaptor;
+import org.hibernate.reactive.engine.jdbc.ResultsCheckerUtil;
import org.hibernate.reactive.engine.jdbc.env.internal.ReactiveMutationExecutor;
import org.hibernate.reactive.generator.values.ReactiveGeneratedValuesMutationDelegate;
import org.hibernate.reactive.logging.impl.Log;
@@ -37,9 +34,16 @@
import org.hibernate.sql.model.TableMapping;
import org.hibernate.sql.model.ValuesAnalysis;
+import java.lang.invoke.MethodHandles;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletionStage;
+
import static org.hibernate.engine.jdbc.mutation.internal.ModelMutationHelper.checkResults;
import static org.hibernate.reactive.logging.impl.LoggerFactory.make;
import static org.hibernate.reactive.util.impl.CompletionStages.failedFuture;
+import static org.hibernate.reactive.util.impl.CompletionStages.loop;
import static org.hibernate.reactive.util.impl.CompletionStages.nullFuture;
import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture;
import static org.hibernate.sql.model.ModelMutationLogging.MODEL_MUTATION_LOGGER;
@@ -73,10 +77,64 @@ private ReactiveConnection connection(SharedSessionContractImplementor session)
@Override
public CompletionStage performReactiveBatchedOperations(
ValuesAnalysis valuesAnalysis,
- TableInclusionChecker inclusionChecker, OperationResultChecker resultChecker,
+ TableInclusionChecker inclusionChecker,
+ OperationResultChecker resultChecker,
SharedSessionContractImplementor session) {
- return ReactiveMutationExecutor.super
- .performReactiveBatchedOperations( valuesAnalysis, inclusionChecker, resultChecker, session);
+ final PreparedStatementGroup batchedMutationOperationGroup = getBatchedPreparedStatementGroup();
+ if ( batchedMutationOperationGroup != null ) {
+ final List preparedStatementDetailsList = new ArrayList<>(
+ batchedMutationOperationGroup.getNumberOfStatements() );
+ batchedMutationOperationGroup.forEachStatement( (tableName, statementDetails) -> preparedStatementDetailsList
+ .add( statementDetails ) );
+ return loop( preparedStatementDetailsList, statementDetails -> {
+ if ( statementDetails == null ) {
+ return voidFuture();
+ }
+ final JdbcValueBindings valueBindings = getJdbcValueBindings();
+ final TableMapping tableDetails = statementDetails.getMutatingTableDetails();
+ if ( inclusionChecker != null && !inclusionChecker.include( tableDetails ) ) {
+ if ( MODEL_MUTATION_LOGGER.isTraceEnabled() ) {
+ MODEL_MUTATION_LOGGER.tracef(
+ "Skipping execution of secondary insert : %s",
+ tableDetails.getTableName()
+ );
+ }
+ return voidFuture();
+ }
+
+ // If we get here the statement is needed - make sure it is resolved
+ final Object[] paramValues = PreparedStatementAdaptor.bind( statement -> {
+ PreparedStatementDetails details = new PrepareStatementDetailsAdaptor(
+ statementDetails,
+ statement,
+ session.getJdbcServices()
+ );
+ valueBindings.beforeStatement( details );
+ } );
+
+ final ReactiveConnection reactiveConnection = ( (ReactiveConnectionSupplier) session ).getReactiveConnection();
+ final String sql = statementDetails.getSqlString();
+ return reactiveConnection.update(
+ sql,
+ paramValues,
+ true,
+ (rowCount, batchPosition, query) -> ResultsCheckerUtil.checkResults(
+ session,
+ statementDetails,
+ resultChecker,
+ rowCount,
+ batchPosition
+ )
+ ).whenComplete( (o, throwable) -> { //TODO: is this part really needed?
+ if ( statementDetails.getStatement() != null ) {
+ statementDetails.releaseStatement( session );
+ }
+ valueBindings.afterStatement( tableDetails );
+ } );
+ }
+ );
+ }
+ return voidFuture();
}
@Override
@@ -159,6 +217,23 @@ public CompletionStage performReactiveNonBatchedOperations(
}
}
+ @Override
+ public CompletionStage performReactiveSelfExecutingOperations(
+ ValuesAnalysis valuesAnalysis,
+ TableInclusionChecker inclusionChecker,
+ SharedSessionContractImplementor session) {
+ if ( getSelfExecutingMutations() == null || getSelfExecutingMutations().isEmpty() ) {
+ return voidFuture();
+ }
+
+ return loop( getSelfExecutingMutations(), operation -> {
+ if ( inclusionChecker.include( operation.getTableDetails() ) ) {
+ operation.performMutation( getJdbcValueBindings(), valuesAnalysis, session );
+ }
+ return voidFuture();
+ });
+ }
+
private class OperationsForEach {
private final Object id;
@@ -210,6 +285,7 @@ public CompletionStage buildLoop() {
return loop;
}
}
+
@Override
public CompletionStage performReactiveNonBatchedMutation(
PreparedStatementDetails statementDetails,
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/event/impl/DefaultReactiveDeleteEventListener.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/event/impl/DefaultReactiveDeleteEventListener.java
index 664b09da3..f490d5366 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/event/impl/DefaultReactiveDeleteEventListener.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/event/impl/DefaultReactiveDeleteEventListener.java
@@ -436,11 +436,8 @@ protected CompletionStage deleteEntity(
persister
).nullifyTransientReferences( entityEntry.getDeletedState() )
.thenAccept( vv -> {
- new Nullability( session ).checkNullability(
- entityEntry.getDeletedState(),
- persister,
- Nullability.NullabilityCheckType.DELETE
- );
+ new Nullability( session, Nullability.NullabilityCheckType.DELETE )
+ .checkNullability( entityEntry.getDeletedState(), persister );
persistenceContext.registerNullifiableEntityKey( key );
final ReactiveActionQueue actionQueue = actionQueue( session );
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveEntityBatchLoaderArrayParam.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveEntityBatchLoaderArrayParam.java
index ba69fd407..04f971ffd 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveEntityBatchLoaderArrayParam.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveEntityBatchLoaderArrayParam.java
@@ -10,7 +10,6 @@
import java.util.concurrent.CompletionStage;
import org.hibernate.LockOptions;
-import org.hibernate.engine.internal.BatchFetchQueueHelper;
import org.hibernate.engine.spi.EntityKey;
import org.hibernate.engine.spi.LoadQueryInfluencers;
import org.hibernate.engine.spi.SessionFactoryImplementor;
@@ -160,7 +159,8 @@ private CompletionStage initializeEntities(
continue;
}
// found or not, remove the key from the batch-fetch queue
- BatchFetchQueueHelper.removeBatchLoadableEntityKey( id, getLoadable(), session );
+ session.getPersistenceContextInternal().getBatchFetchQueue()
+ .removeBatchLoadableEntityKey( session.generateEntityKey( id, getLoadable().getEntityPersister() ) );
}
} );
}
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java
index 8495d115b..8239a6e15 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveMultiIdEntityLoaderArrayParam.java
@@ -13,7 +13,6 @@
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
-import org.hibernate.engine.internal.BatchFetchQueueHelper;
import org.hibernate.engine.spi.BatchFetchQueue;
import org.hibernate.engine.spi.EntityEntry;
import org.hibernate.engine.spi.EntityKey;
@@ -206,7 +205,7 @@ protected CompletionStage> performOrderedMultiLoad(
// the element value at this position in the result List should be
// the EntityKey for that entity - reuse it
final EntityKey entityKey = (EntityKey) result.get( resultIndex );
- BatchFetchQueueHelper.removeBatchLoadableEntityKey( entityKey, session );
+ session.getPersistenceContextInternal().getBatchFetchQueue().removeBatchLoadableEntityKey( entityKey );
Object entity = persistenceContext.getEntity( entityKey );
if ( entity != null && !loadOptions.isReturnOfDeletedEntitiesEnabled() ) {
// make sure it is not DELETED
@@ -293,7 +292,8 @@ protected CompletionStage> performUnorderedMultiLoad(
continue;
}
// found or not, remove the key from the batch-fetch queue
- BatchFetchQueueHelper.removeBatchLoadableEntityKey( id, getLoadable(), session );
+ session.getPersistenceContextInternal().getBatchFetchQueue()
+ .removeBatchLoadableEntityKey( session.generateEntityKey( id, getLoadable().getEntityPersister() ) );
}
return result;
diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveSingleIdEntityLoaderProvidedQueryImpl.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveSingleIdEntityLoaderProvidedQueryImpl.java
index b2ec82649..a2b3a384e 100644
--- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveSingleIdEntityLoaderProvidedQueryImpl.java
+++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/loader/ast/internal/ReactiveSingleIdEntityLoaderProvidedQueryImpl.java
@@ -7,17 +7,18 @@
import java.util.concurrent.CompletionStage;
-import org.hibernate.FlushMode;
import org.hibernate.LockOptions;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.metamodel.mapping.EntityMappingType;
+import org.hibernate.query.Query;
+import org.hibernate.query.QueryFlushMode;
import org.hibernate.query.named.NamedQueryMemento;
-import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.reactive.loader.ast.spi.ReactiveSingleIdEntityLoader;
import org.hibernate.reactive.query.ReactiveSelectionQuery;
import jakarta.persistence.Parameter;
+import org.hibernate.type.descriptor.java.JavaType;
import static org.hibernate.reactive.util.impl.CompletionStages.completedFuture;
@@ -30,9 +31,9 @@ public class ReactiveSingleIdEntityLoaderProvidedQueryImpl implements Reactiv
private static final CompletionStage