Class SpringHibernateConnectionOperations
java.lang.Object
io.micronaut.data.spring.jpa.hibernate.SpringHibernateConnectionOperations
- All Implemented Interfaces:
ConnectionOperations<org.hibernate.Session>
@Internal
@EachBean(org.hibernate.SessionFactory.class)
@Replaces(HibernateConnectionOperations.class)
public final class SpringHibernateConnectionOperations
extends Object
implements ConnectionOperations<org.hibernate.Session>
Spring JDBC Hibernate Session operations.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescription<R> R
execute
(ConnectionDefinition definition, Function<ConnectionStatus<org.hibernate.Session>, R> callback) Execute a connection within the context of the function.Optional<ConnectionStatus<org.hibernate.Session>>
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
-
Method Details
-
findConnectionStatus
Description copied from interface:ConnectionOperations
Obtains the current connection.- Specified by:
findConnectionStatus
in interfaceConnectionOperations<org.hibernate.Session>
- Returns:
- The optional connection
-
execute
public <R> R execute(ConnectionDefinition definition, Function<ConnectionStatus<org.hibernate.Session>, R> callback) Description copied from interface:ConnectionOperations
Execute a connection within the context of the function.- Specified by:
execute
in interfaceConnectionOperations<org.hibernate.Session>
- Type Parameters:
R
- The result- Parameters:
definition
- The connection definitioncallback
- The call back- Returns:
- The result
-