类 OpenJpaDialect
- java.lang.Object
- org.springframework.orm.jpa.DefaultJpaDialect
- org.springframework.orm.jpa.vendor.OpenJpaDialect
- 所有已实现的接口:
Serializable
,PersistenceExceptionTranslator
,JpaDialect
public class OpenJpaDialect extends DefaultJpaDialect
JpaDialect
implementation for Apache OpenJPA. Developed and tested against OpenJPA 2.2.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, Costin Leau
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 OpenJpaDialect()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Object
beginTransaction(EntityManager entityManager, TransactionDefinition definition)
This implementation invokes the standard JPATransaction.begin
method.ConnectionHandle
getJdbcConnection(EntityManager entityManager, boolean readOnly)
This implementation always returnsnull
, indicating that no JDBC Connection can be provided.protected org.apache.openjpa.persistence.OpenJPAEntityManager
getOpenJPAEntityManager(EntityManager em)
Return the OpenJPA-specific variant ofEntityManager
.从类继承的方法 org.springframework.orm.jpa.DefaultJpaDialect
cleanupTransaction, prepareTransaction, releaseJdbcConnection, translateExceptionIfPossible
构造器详细资料
OpenJpaDialect
public OpenJpaDialect()
方法详细资料
beginTransaction
public Object beginTransaction(EntityManager entityManager, TransactionDefinition definition) throws PersistenceException, SQLException, TransactionException
从类复制的说明:DefaultJpaDialect
This implementation invokes the standard JPATransaction.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.- 指定者:
beginTransaction
在接口中JpaDialect
- 覆盖:
beginTransaction
在类中DefaultJpaDialect
- 参数:
entityManager
- the EntityManager to begin a JPA transaction ondefinition
- the Spring transaction definition that defines semantics- 返回:
- an arbitrary object that holds transaction data, if any (to be passed into
JpaDialect.cleanupTransaction(java.lang.Object)
). May implement theSavepointManager
interface. - 抛出:
PersistenceException
- if thrown by JPA methodsSQLException
- if thrown by JDBC methodsTransactionException
- in case of invalid arguments- 另请参阅:
EntityTransaction.begin()
,InvalidIsolationLevelException
,DefaultJpaDialect.cleanupTransaction(java.lang.Object)
getJdbcConnection
public ConnectionHandle getJdbcConnection(EntityManager entityManager, boolean readOnly) throws PersistenceException, SQLException
从类复制的说明:DefaultJpaDialect
This implementation always returnsnull
, indicating that no JDBC Connection can be provided.- 指定者:
getJdbcConnection
在接口中JpaDialect
- 覆盖:
getJdbcConnection
在类中DefaultJpaDialect
- 参数:
entityManager
- the current JPA EntityManagerreadOnly
- whether the Connection is only needed for read-only purposes- 返回:
- a handle for the Connection, to be passed into
releaseJdbcConnection
, ornull
if no JDBC Connection can be retrieved - 抛出:
PersistenceException
- if thrown by JPA methodsSQLException
- if thrown by JDBC methods- 另请参阅:
JpaDialect.releaseJdbcConnection(org.springframework.jdbc.datasource.ConnectionHandle, javax.persistence.EntityManager)
,ConnectionHandle.getConnection()
,SimpleConnectionHandle
,JpaTransactionManager.setDataSource(javax.sql.DataSource)
,NativeJdbcExtractor
getOpenJPAEntityManager
protected org.apache.openjpa.persistence.OpenJPAEntityManager getOpenJPAEntityManager(EntityManager em)
Return the OpenJPA-specific variant ofEntityManager
.- 参数:
em
- the genericEntityManager
instance- 返回:
- the OpenJPA-specific variant of
EntityManager