|
29 | 29 | import org.hibernate.query.criteria.HibernateCriteriaBuilder;
|
30 | 30 | import org.hibernate.query.criteria.JpaCriteriaInsert;
|
31 | 31 | import org.hibernate.reactive.common.AffectedEntities;
|
| 32 | +import org.hibernate.reactive.common.ConnectionConsumer; |
32 | 33 | import org.hibernate.reactive.common.Identifier;
|
33 | 34 | import org.hibernate.reactive.common.ResultSetMapping;
|
34 | 35 | import org.hibernate.reactive.logging.impl.Log;
|
@@ -1557,6 +1558,18 @@ default Session setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode) {
|
1557 | 1558 | * The {@link SessionFactory} which created this session.
|
1558 | 1559 | */
|
1559 | 1560 | SessionFactory getFactory();
|
| 1561 | + |
| 1562 | + /** |
| 1563 | + * Execute the given operation using the connection underlying the reactive session. |
| 1564 | + * |
| 1565 | + * @param consumer the operation to be executed |
| 1566 | + * @return the result of the operation via a {@link CompletionStage} |
| 1567 | + * |
| 1568 | + * @param <C> the connection type, usually |
| 1569 | + * {@link io.vertx.sqlclient.SqlConnection} |
| 1570 | + * @param <R> the result type of the operation, or {@link Void} |
| 1571 | + */ |
| 1572 | + <C,R> CompletionStage<R> withConnection(ConnectionConsumer<C,R> consumer); |
1560 | 1573 | }
|
1561 | 1574 |
|
1562 | 1575 | /**
|
@@ -2155,6 +2168,18 @@ default CompletionStage<Void> refresh(Object entity, LockModeType lockModeType)
|
2155 | 2168 | * The {@link SessionFactory} which created this session.
|
2156 | 2169 | */
|
2157 | 2170 | SessionFactory getFactory();
|
| 2171 | + |
| 2172 | + /** |
| 2173 | + * Execute the given operation using the connection underlying the reactive session. |
| 2174 | + * |
| 2175 | + * @param consumer the operation to be executed |
| 2176 | + * @return the result of the operation via a {@link CompletionStage} |
| 2177 | + * |
| 2178 | + * @param <C> the connection type, usually |
| 2179 | + * {@link io.vertx.sqlclient.SqlConnection} |
| 2180 | + * @param <R> the result type of the operation, or {@link Void} |
| 2181 | + */ |
| 2182 | + <C,R> CompletionStage<R> withConnection(ConnectionConsumer<C,R> consumer); |
2158 | 2183 | }
|
2159 | 2184 |
|
2160 | 2185 | /**
|
|
0 commit comments