Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework » orm » jpa » [javadoc | source]
org.springframework.orm.jpa
public class: DefaultJpaDialect [javadoc | source]
java.lang.Object
   org.springframework.orm.jpa.DefaultJpaDialect

All Implemented Interfaces:
    Serializable, JpaDialect

Direct Known Subclasses:
    HibernateJpaDialect, OpenJpaDialect, TopLinkJpaDialect, EclipseLinkJpaDialect

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 .

Method from org.springframework.orm.jpa.DefaultJpaDialect Summary:
beginTransaction,   cleanupTransaction,   getEntityManagerFactoryPlusOperations,   getEntityManagerPlusOperations,   getJdbcConnection,   prepareTransaction,   releaseJdbcConnection,   supportsEntityManagerFactoryPlusOperations,   supportsEntityManagerPlusOperations,   translateExceptionIfPossible
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.orm.jpa.DefaultJpaDialect Detail:
 public Object beginTransaction(EntityManager entityManager,
    TransactionDefinition definition) throws TransactionException, SQLException, PersistenceException 
    This implementation invokes the standard JPA Transaction.begin method. Throws an InvalidIsolationLevelException if a non-default isolation level is set.

    This implementation does not return any transaction data Object, since there is no state to be kept for a standard JPA transaction. Hence, subclasses do not have to care about the return value (null) of this implementation and are free to return their own transaction data Object.

 public  void cleanupTransaction(Object transactionData) 
    This implementation does nothing, since the default beginTransaction implementation does not require any cleanup.
 public EntityManagerFactoryPlusOperations getEntityManagerFactoryPlusOperations(EntityManagerFactory rawEntityManager) 
 public EntityManagerPlusOperations getEntityManagerPlusOperations(EntityManager rawEntityManager) 
 public ConnectionHandle getJdbcConnection(EntityManager entityManager,
    boolean readOnly) throws SQLException, PersistenceException 
    This implementation always returns null, indicating that no JDBC Connection can be provided.
 public Object prepareTransaction(EntityManager entityManager,
    boolean readOnly,
    String name) throws PersistenceException 
 public  void releaseJdbcConnection(ConnectionHandle conHandle,
    EntityManager em) throws SQLException, PersistenceException 
    This implementation does nothing, assuming that the Connection will implicitly be closed with the EntityManager.

    If the JPA implementation returns a Connection handle that it expects the application to close after use, the dialect implementation needs to invoke Connection.close() (or some other method with similar effect) here.

 public boolean supportsEntityManagerFactoryPlusOperations() 
 public boolean supportsEntityManagerPlusOperations() 
 public DataAccessException translateExceptionIfPossible(RuntimeException ex) 
    This implementation delegates to EntityManagerFactoryUtils.