|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.orm.jpa.DefaultJpaDialect
public class DefaultJpaDialect
Default implementation of the JpaDialect interface. Used as default dialect by JpaAccessor and JpaTransactionManager.
Simply begins a standard JPA transaction in beginTransaction
and performs standard exception translation through EntityManagerFactoryUtils.
JpaAccessor.setJpaDialect(org.springframework.orm.jpa.JpaDialect),
JpaTransactionManager.setJpaDialect(org.springframework.orm.jpa.JpaDialect)| Constructor Summary | |
|---|---|
DefaultJpaDialect()
|
|
| Method Summary | |
|---|---|
Object |
beginTransaction(javax.persistence.EntityManager entityManager,
TransactionDefinition definition)
This implementation invokes the standard JPA Transaction.begin
method. |
void |
cleanupTransaction(Object transactionData)
This implementation does nothing, as the default beginTransaction implementation does not require any cleanup. |
EntityManagerFactoryPlusOperations |
getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager)
Return an EntityManagerFactoryPlusOperations implementation for the given raw EntityManagerFactory. |
EntityManagerPlusOperations |
getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager)
Return an EntityManagerPlusOperations implementation for the given raw EntityManager. |
ConnectionHandle |
getJdbcConnection(javax.persistence.EntityManager entityManager,
boolean readOnly)
This implementation always returns null. |
void |
releaseJdbcConnection(ConnectionHandle conHandle,
javax.persistence.EntityManager em)
This implementation does nothing, assuming that the Connection will implicitly be closed with the EntityManager. |
boolean |
supportsEntityManagerFactoryPlusOperations()
Return whether the EntityManagerFactoryPlus(Operations) interface is supported by this provider. |
boolean |
supportsEntityManagerPlusOperations()
Return whether the EntityManagerPlus(Operations) interface is supported by this provider. |
DataAccessException |
translateExceptionIfPossible(RuntimeException ex)
This implementation delegates to EntityManagerFactoryUtils. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultJpaDialect()
| Method Detail |
|---|
public Object beginTransaction(javax.persistence.EntityManager entityManager,
TransactionDefinition definition)
throws javax.persistence.PersistenceException,
SQLException,
TransactionException
Transaction.begin
method. Throws an InvalidIsolationLevelException if a non-default isolation
level is set.
beginTransaction in interface JpaDialectentityManager - the EntityManager to begin a JPA transaction ondefinition - the Spring transaction definition that defines semantics
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methods
TransactionException - in case of invalid argumentsEntityTransaction.begin(),
InvalidIsolationLevelExceptionpublic void cleanupTransaction(Object transactionData)
cleanupTransaction in interface JpaDialecttransactionData - arbitrary object that holds transaction data, if any
(as returned by beginTransaction)beginTransaction(javax.persistence.EntityManager, org.springframework.transaction.TransactionDefinition)
public ConnectionHandle getJdbcConnection(javax.persistence.EntityManager entityManager,
boolean readOnly)
throws javax.persistence.PersistenceException,
SQLException
null.
getJdbcConnection in interface JpaDialectentityManager - the current JPA EntityManager
releaseJdbcConnection, or null
if no JDBC Connection can be retrieved
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methodsJpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager),
ConnectionHandle.getConnection(),
SimpleConnectionHandle,
JpaTransactionManager.setDataSource(javax.sql.DataSource),
NativeJdbcExtractor
public void releaseJdbcConnection(ConnectionHandle conHandle,
javax.persistence.EntityManager em)
throws javax.persistence.PersistenceException,
SQLException
If the JPA implementation returns a Connection handle that
it expects the application to close, the dialect needs to invoke
Connection.close here.
releaseJdbcConnection in interface JpaDialectconHandle - the JDBC Connection handle to releaseem - the current JPA EntityManager
javax.persistence.PersistenceException - if thrown by JPA methods
SQLException - if thrown by JDBC methodsConnection.close()public DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible in interface PersistenceExceptionTranslatorex - a RuntimeException thrown
null if the
exception could not be translated, as in this case it may result from
user code rather than an actual persistence problem)EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(java.lang.RuntimeException)public boolean supportsEntityManagerFactoryPlusOperations()
JpaDialect
supportsEntityManagerFactoryPlusOperations in interface JpaDialectEntityManagerFactoryPlusOperations,
EntityManagerFactoryPluspublic boolean supportsEntityManagerPlusOperations()
JpaDialect
supportsEntityManagerPlusOperations in interface JpaDialectEntityManagerPlusOperations,
EntityManagerPluspublic EntityManagerFactoryPlusOperations getEntityManagerFactoryPlusOperations(javax.persistence.EntityManagerFactory rawEntityManager)
JpaDialect
getEntityManagerFactoryPlusOperations in interface JpaDialectrawEntityManager - the raw provider-specific EntityManagerFactory
public EntityManagerPlusOperations getEntityManagerPlusOperations(javax.persistence.EntityManager rawEntityManager)
JpaDialect
getEntityManagerPlusOperations in interface JpaDialectrawEntityManager - the raw provider-specific EntityManagerFactory
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||