@Requires(classes=org.springframework.orm.hibernate5.HibernateTransactionManager.class) @EachBean(value=org.springframework.orm.hibernate5.HibernateTransactionManager.class) @Internal @Replaces(value=SpringJdbcTransactionOperations.class) public class SpringHibernateTransactionOperations extends java.lang.Object implements TransactionOperations<javax.persistence.EntityManager>
| Modifier | Constructor and Description |
|---|---|
protected |
SpringHibernateTransactionOperations(org.springframework.orm.hibernate5.HibernateTransactionManager hibernateTransactionManager)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<R> R |
execute(TransactionDefinition definition,
TransactionCallback<javax.persistence.EntityManager,R> callback)
Execute a read-only transaction within the context of the function.
|
<R> R |
executeRead(TransactionCallback<javax.persistence.EntityManager,R> callback)
Execute a read-only transaction within the context of the function.
|
<R> R |
executeWrite(TransactionCallback<javax.persistence.EntityManager,R> callback)
Execute a default transaction within the context of the function.
|
javax.persistence.EntityManager |
getConnection()
Obtains the connection for the current transaction.
|
protected SpringHibernateTransactionOperations(org.springframework.orm.hibernate5.HibernateTransactionManager hibernateTransactionManager)
hibernateTransactionManager - The hibernate transaction manager.public <R> R executeRead(@NonNull
TransactionCallback<javax.persistence.EntityManager,R> callback)
TransactionOperationsexecuteRead in interface TransactionOperations<javax.persistence.EntityManager>R - The resultcallback - The call backpublic <R> R executeWrite(@NonNull
TransactionCallback<javax.persistence.EntityManager,R> callback)
TransactionOperationsexecuteWrite in interface TransactionOperations<javax.persistence.EntityManager>R - The resultcallback - The call back@NonNull public javax.persistence.EntityManager getConnection()
TransactionOperationsgetConnection in interface TransactionOperations<javax.persistence.EntityManager>public <R> R execute(@NonNull
TransactionDefinition definition,
@NonNull
TransactionCallback<javax.persistence.EntityManager,R> callback)
TransactionOperationsexecute in interface TransactionOperations<javax.persistence.EntityManager>R - The resultdefinition - The transaction definitioncallback - The call back