FileDocCategorySizeDatePackage
InjectedSessionFactory.javaAPI DocJBoss 4.2.16895Fri Jul 13 20:53:58 BST 2007org.jboss.ejb3.entity

InjectedSessionFactory

public class InjectedSessionFactory extends Object implements org.hibernate.SessionFactory, Externalizable
Comment
author
Bill Burke
version
$Revision: 62768 $

Fields Summary
private static final long
serialVersionUID
private transient javax.persistence.EntityManagerFactory
delegate
private transient ManagedEntityManagerFactory
managedFactory
Constructors Summary
public InjectedSessionFactory(ManagedEntityManagerFactory factory)


     
   
      this.managedFactory = factory;
      this.delegate = factory.getEntityManagerFactory();
   
public InjectedSessionFactory()

Methods Summary
public voidclose()

      throw new IllegalStateException("It is illegal to close an injected SessionFactory");
   
public voidevict(java.lang.Class persistentClass)

      getSessionFactory().evict(persistentClass);
   
public voidevict(java.lang.Class persistentClass, java.io.Serializable id)

      getSessionFactory().evict(persistentClass, id);
   
public voidevictCollection(java.lang.String roleName)

      getSessionFactory().evictCollection(roleName);
   
public voidevictCollection(java.lang.String roleName, java.io.Serializable id)

      getSessionFactory().evictCollection(roleName, id);
   
public voidevictEntity(java.lang.String entityName)

      getSessionFactory().evictEntity(entityName);
   
public voidevictEntity(java.lang.String entityName, java.io.Serializable id)

      getSessionFactory().evictEntity(entityName, id);
   
public voidevictQueries()

      getSessionFactory().evictQueries();
   
public voidevictQueries(java.lang.String cacheRegion)

      getSessionFactory().evictQueries(cacheRegion);
   
public java.util.MapgetAllClassMetadata()

      return getSessionFactory().getAllClassMetadata();
   
public java.util.MapgetAllCollectionMetadata()

      return getSessionFactory().getAllCollectionMetadata();
   
public org.hibernate.metadata.ClassMetadatagetClassMetadata(java.lang.Class persistentClass)

      return getSessionFactory().getClassMetadata(persistentClass);
   
public org.hibernate.metadata.ClassMetadatagetClassMetadata(java.lang.String entityName)

      return getSessionFactory().getClassMetadata(entityName);
   
public org.hibernate.metadata.CollectionMetadatagetCollectionMetadata(java.lang.String roleName)

      return getSessionFactory().getCollectionMetadata(roleName);
   
public org.hibernate.classic.SessiongetCurrentSession()

      return getSessionFactory().getCurrentSession();
   
public java.util.SetgetDefinedFilterNames()

      return getSessionFactory().getDefinedFilterNames();
   
private javax.persistence.EntityManagerFactorygetDelegate()

      return delegate;
   
public org.hibernate.engine.FilterDefinitiongetFilterDefinition(java.lang.String filterName)

      return getSessionFactory().getFilterDefinition(filterName);
   
public javax.naming.ReferencegetReference()

      return getSessionFactory().getReference();
   
private org.hibernate.SessionFactorygetSessionFactory()

      return ((HibernateEntityManagerFactory)getDelegate()).getSessionFactory();
   
public org.hibernate.stat.StatisticsgetStatistics()

      return getSessionFactory().getStatistics();
   
public booleanisClosed()

      return getSessionFactory().isClosed();
   
public org.hibernate.classic.SessionopenSession(org.hibernate.Interceptor interceptor)

      return getSessionFactory().openSession(interceptor);
   
public org.hibernate.classic.SessionopenSession(java.sql.Connection connection, org.hibernate.Interceptor interceptor)

      return getSessionFactory().openSession(connection, interceptor);
   
public org.hibernate.classic.SessionopenSession()

      return getSessionFactory().openSession();
   
public org.hibernate.classic.SessionopenSession(java.sql.Connection connection)

      return getSessionFactory().openSession(connection);
   
public org.hibernate.StatelessSessionopenStatelessSession()

      return getSessionFactory().openStatelessSession();
   
public org.hibernate.StatelessSessionopenStatelessSession(java.sql.Connection connection)

      return getSessionFactory().openStatelessSession(connection);
   
public voidreadExternal(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);
      managedFactory = deployment.getManagedFactory();
      delegate = managedFactory.getEntityManagerFactory();
   
public voidwriteExternal(java.io.ObjectOutput out)

      out.writeUTF(managedFactory.getKernelName());