Class HibernateConnectionConnectionOperations
java.lang.Object
io.micronaut.data.hibernate.connection.HibernateConnectionConnectionOperations
- All Implemented Interfaces:
ConnectionOperations<Connection>
@Order(200)
@Internal
@RequiresSyncHibernate
@EachBean(HibernateConnectionOperations.class)
@Replaces(DefaultDataSourceConnectionOperations.class)
public final class HibernateConnectionConnectionOperations
extends Object
implements ConnectionOperations<Connection>
The connection operations that extract
Connection
from Hibernate Session.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorDescriptionHibernateConnectionConnectionOperations
(HibernateConnectionOperations hibernateConnectionOperations) -
Method Summary
Modifier and TypeMethodDescription<R> R
execute
(ConnectionDefinition definition, Function<ConnectionStatus<Connection>, R> callback) Execute a connection within the context of the function.Obtains the current connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.connection.ConnectionOperations
executeRead, executeWrite, getConnectionStatus
-
Constructor Details
-
HibernateConnectionConnectionOperations
public HibernateConnectionConnectionOperations(HibernateConnectionOperations hibernateConnectionOperations)
-
-
Method Details
-
findConnectionStatus
Description copied from interface:ConnectionOperations
Obtains the current connection.- Specified by:
findConnectionStatus
in interfaceConnectionOperations<Connection>
- Returns:
- The optional connection
-
execute
public <R> R execute(ConnectionDefinition definition, Function<ConnectionStatus<Connection>, R> callback) Description copied from interface:ConnectionOperations
Execute a connection within the context of the function.- Specified by:
execute
in interfaceConnectionOperations<Connection>
- Type Parameters:
R
- The result- Parameters:
definition
- The connection definitioncallback
- The call back- Returns:
- The result
-