@Requires(classes=org.springframework.orm.hibernate5.HibernateTransactionManager.class) @EachBean(value=org.springframework.orm.hibernate5.HibernateTransactionManager.class) @Internal 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 |
executeRead(TransactionCallback<javax.persistence.EntityManager,R> callback)
Execute a read operation for the given
TransactionCallback. |
<R> R |
executeWrite(TransactionCallback<javax.persistence.EntityManager,R> callback)
Execute a write operation for the given
TransactionCallback. |
javax.persistence.EntityManager |
getConnection()
Obtains the connection for the current transaction.
|
protected SpringHibernateTransactionOperations(org.springframework.orm.hibernate5.HibernateTransactionManager hibernateTransactionManager)
hibernateTransactionManager - The hibernate transaction manager.@Nullable
public <R> R executeWrite(@NonNull
TransactionCallback<javax.persistence.EntityManager,R> callback)
TransactionOperationsTransactionCallback.executeWrite in interface TransactionOperations<javax.persistence.EntityManager>R - The return typecallback - The callback@Nullable
public <R> R executeRead(@NonNull
TransactionCallback<javax.persistence.EntityManager,R> callback)
TransactionOperationsTransactionCallback.executeRead in interface TransactionOperations<javax.persistence.EntityManager>R - The return typecallback - The callback@NonNull public javax.persistence.EntityManager getConnection()
TransactionOperationsgetConnection in interface TransactionOperations<javax.persistence.EntityManager>