play.db.jpa
类 JPAConfig
java.lang.Object
play.db.jpa.JPAConfig
public class JPAConfig
- extends java.lang.Object
JPA Support for a specific JPA/DB configuration
dbConfigName corresponds to properties-names in application.conf.
The default DBConfig is the one configured using 'db.' in application.conf
dbConfigName = 'other' is configured like this:
db_other = mem
db_other.user = batman
A particular JPAConfig-instance uses the DBConfig with the same configName
构造方法摘要 |
protected |
JPAConfig(org.hibernate.ejb.Ejb3Configuration cfg,
java.lang.String configName)
|
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jpql
public final JPQL jpql
JPAConfig
protected JPAConfig(org.hibernate.ejb.Ejb3Configuration cfg,
java.lang.String configName)
getConfigName
public java.lang.String getConfigName()
close
protected void close()
isEnabled
public boolean isEnabled()
- 返回:
- true if an entityManagerFactory has started
newEntityManager
public EntityManager newEntityManager()
getJPAContext
public JPAContext getJPAContext()
- gets the active or create new
- 返回:
- the active JPAContext bound to current thread
getJPAContext
protected JPAContext getJPAContext(java.lang.Boolean manualReadOnly)
- gets the active or create new. manualReadOnly is only used if we're create new context
- 参数:
manualReadOnly
- is not null, this value is used instead of value from @Transactional.readOnly
- 返回:
- the active JPAContext bound to current thread
clearJPAContext
protected void clearJPAContext()
threadHasJPAContext
public boolean threadHasJPAContext()
- 返回:
- true if JPA is enabled in current thread
isInsideTransaction
public boolean isInsideTransaction()
invokeJPAConfigurationExtensions
protected void invokeJPAConfigurationExtensions(org.hibernate.ejb.Ejb3Configuration cfg,
java.lang.String configName)
- Looks up all
JPAConfigurationExtension
implementations and applies them to the JPA configuration.
- 参数:
cfg
- the
Ejb3Configuration for this JPAConfig
configName
- the name of the db configuration
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly