Methods Summary |
---|
protected org.hibernate.Session | getHibernateSession()
if ( getSession() instanceof HibernateEntityManager )
{
return ( (HibernateEntityManager) getSession() ).getSession();
}
throw new RuntimeException( "ILLEGAL ACTION: Not a Hibernate persistence provider" );
|
protected javax.persistence.EntityManager | getSession()
return factory.getTransactionScopedEntityManager();
|
public java.lang.Object | invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
if ( "close".equals( method.getName() ) ) {
throw new IllegalStateException("Illegal to call this method from injected, managed EntityManager");
}
else {
//catch all
try {
return method.invoke( getHibernateSession(), args );
}
catch ( InvocationTargetException e ) {
if ( e.getTargetException() instanceof RuntimeException ) {
throw ( RuntimeException ) e.getTargetException();
}
else {
throw e;
}
}
}
|
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 | writeExternal(java.io.ObjectOutput out)
out.writeUTF( factory.getKernelName() );
|