Methods Summary |
---|
public void | clear()
factory.getTransactionScopedEntityManager().clear();
|
public void | close()
throw new IllegalStateException("Illegal to call this method from injected, managed EntityManager");
|
public boolean | contains(java.lang.Object entity)
return factory.getTransactionScopedEntityManager().contains(entity);
|
public javax.persistence.Query | createNamedQuery(java.lang.String name)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
return em.createNamedQuery(name);
|
public javax.persistence.Query | createNativeQuery(java.lang.String sqlString)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
return em.createNativeQuery(sqlString);
|
public javax.persistence.Query | createNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
return em.createNativeQuery(sqlString, resultClass);
|
public javax.persistence.Query | createNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
return em.createNativeQuery(sqlString, resultSetMapping);
|
public javax.persistence.Query | createQuery(java.lang.String ejbqlString)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
return em.createQuery(ejbqlString);
|
public A | find(java.lang.Class entityClass, java.lang.Object primaryKey)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
try
{
return em.find(entityClass, primaryKey);
}
finally
{
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
}
|
public void | flush()
factory.verifyInTx();
factory.getTransactionScopedEntityManager().flush();
|
public java.lang.Object | getDelegate()
return factory.getTransactionScopedEntityManager().getDelegate();
|
public javax.persistence.FlushModeType | getFlushMode()
return factory.getTransactionScopedEntityManager().getFlushMode();
|
public org.hibernate.Session | getHibernateSession()
EntityManager em = factory.getTransactionScopedEntityManager();
if (em instanceof HibernateEntityManager)
{
return ((HibernateEntityManager) em).getSession();
}
throw new RuntimeException("ILLEGAL ACTION: Not a Hibernate pe" +
"rsistence provider");
|
public T | getReference(java.lang.Class entityClass, java.lang.Object primaryKey)
EntityManager em = factory.getTransactionScopedEntityManager();
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
try
{
return em.getReference(entityClass, primaryKey);
}
finally
{
if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
}
|
public org.hibernate.Session | getSession()
return getHibernateSession();
|
public javax.persistence.EntityTransaction | getTransaction()
throw new IllegalStateException("Illegal to call this method from injected, managed EntityManager");
|
public boolean | isOpen()
throw new IllegalStateException("Illegal to call this method from injected, managed EntityManager");
|
public void | joinTransaction()
factory.verifyInTx();
factory.getTransactionScopedEntityManager().joinTransaction();
|
public void | lock(java.lang.Object entity, javax.persistence.LockModeType lockMode)
factory.verifyInTx();
factory.getTransactionScopedEntityManager().lock(entity, lockMode);
|
public A | merge(A entity)
factory.verifyInTx();
return (A) factory.getTransactionScopedEntityManager().merge(entity);
|
public void | persist(java.lang.Object entity)
factory.verifyInTx();
factory.getTransactionScopedEntityManager().persist(entity);
|
public void | readExternal(java.io.ObjectInput in)
String kernelName = in.readUTF();
PersistenceUnitDeployment deployment = PersistenceUnitRegistry.getPersistenceUnit(kernelName);
if (deployment == null) throw new IOException("Unable to find persistence unit in registry: " + kernelName);
factory = deployment.getManagedFactory();
|
public void | refresh(java.lang.Object entity)
factory.verifyInTx();
factory.getTransactionScopedEntityManager().refresh(entity);
|
public void | remove(java.lang.Object entity)
factory.verifyInTx();
factory.getTransactionScopedEntityManager().remove(entity);
|
public void | setFlushMode(javax.persistence.FlushModeType flushMode)
factory.getTransactionScopedEntityManager().setFlushMode(flushMode);
|
public void | writeExternal(java.io.ObjectOutput out)
out.writeUTF(factory.getKernelName());
|