public class

OpenJpaDialect

extends DefaultJpaDialect
java.lang.Object
   ↳ org.springframework.orm.jpa.DefaultJpaDialect
     ↳ org.springframework.orm.jpa.vendor.OpenJpaDialect

Class Overview

JpaDialect implementation for Apache OpenJPA. Developed and tested against OpenJPA 0.9.7.

Summary

Public Constructors
OpenJpaDialect()
Public Methods
Object beginTransaction(EntityManager entityManager, TransactionDefinition definition)
This implementation invokes the standard JPA Transaction.begin method.
ConnectionHandle getJdbcConnection(EntityManager entityManager, boolean readOnly)
This implementation always returns null, indicating that no JDBC Connection can be provided.
Protected Methods
OpenJPAEntityManager getOpenJPAEntityManager(EntityManager em)
Return the OpenJPA-specific interface of EntityManager.
[Expand]
Inherited Methods
From class org.springframework.orm.jpa.DefaultJpaDialect
From class java.lang.Object
From interface org.springframework.dao.support.PersistenceExceptionTranslator
From interface org.springframework.orm.jpa.JpaDialect

Public Constructors

public OpenJpaDialect ()

Public Methods

public Object beginTransaction (EntityManager entityManager, TransactionDefinition definition)

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.

Parameters
entityManager the EntityManager to begin a JPA transaction on
definition the Spring transaction definition that defines semantics
Returns
Throws
PersistenceException
SQLException
TransactionException

public ConnectionHandle getJdbcConnection (EntityManager entityManager, boolean readOnly)

This implementation always returns null, indicating that no JDBC Connection can be provided.

Parameters
entityManager the current JPA EntityManager
readOnly whether the Connection is only needed for read-only purposes
Returns
  • a handle for the JDBC Connection, to be passed into releaseJdbcConnection, or null if no JDBC Connection can be retrieved
Throws
PersistenceException
SQLException

Protected Methods

protected OpenJPAEntityManager getOpenJPAEntityManager (EntityManager em)

Return the OpenJPA-specific interface of EntityManager.

Parameters
em the generic EntityManager instance
Returns
  • the OpenJPA-specific interface of EntityManager