## org.hibernate.jmx
Class SessionFactoryStub

    java.lang.Object
      org.hibernate.jmx.SessionFactoryStub

All Implemented Interfaces:
  Serializable, Referenceable, SessionFactory

Deprecated. See HHH-6190 for details

    @Deprecated
    public class SessionFactoryStub

extends Object
implements SessionFactory

A flyweight for `SessionFactory`. If the MBean itself does not have classpath to the persistent classes, then a stub will be registered with JNDI and the actual `SessionFactoryImpl` built upon first access.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface org.hibernate.SessionFactory
`SessionFactory.SessionFactoryOptions`

Method Summary
`void` `close()` Deprecated. Destroy this `SessionFactory` and release all resources (caches, connection pools, etc).
`boolean` `containsFetchProfileDefinition(String name)` Deprecated. Determine if this session factory contains a fetch profile definition registered under the given name.
`void` `evict(Class persistentClass)` Deprecated. Evict all entries from the second-level cache.
`void` `evict(Class persistentClass, Serializable id)` Deprecated. Evict an entry from the second-level cache.
`void` `evictCollection(String roleName)` Deprecated. Evict all entries from the second-level cache.
`void` `evictCollection(String roleName, Serializable id)` Deprecated. Evict an entry from the second-level cache.
`void` `evictEntity(String entityName)` Deprecated. Evict all entries from the second-level cache.
`void` `evictEntity(String entityName, Serializable id)` Deprecated. Evict an entry from the second-level cache.
`void` `evictQueries()` Deprecated. Evict any query result sets cached in the default query cache region.
`void` `evictQueries(String cacheRegion)` Deprecated. Evict any query result sets cached in the named query cache region.
`Map<String,ClassMetadata>` `getAllClassMetadata()` Deprecated. Retrieve the `ClassMetadata` for all mapped entities.
`Map` `getAllCollectionMetadata()` Deprecated. Get the `CollectionMetadata` for all mapped collections
`Cache` `getCache()` Deprecated. Obtain direct access to the underlying cache regions.
`ClassMetadata` `getClassMetadata(Class persistentClass)` Deprecated. Retrieve the `ClassMetadata` associated with the given entity class.
`ClassMetadata` `getClassMetadata(String entityName)` Deprecated. Retrieve the `ClassMetadata` associated with the given entity class.
`CollectionMetadata` `getCollectionMetadata(String roleName)` Deprecated. Get the `CollectionMetadata` associated with the named collection role.
`Session` `getCurrentSession()` Deprecated. Obtains the current session.
`Set` `getDefinedFilterNames()` Deprecated. Obtain a set of the names of all filters defined on this SessionFactory.
`FilterDefinition` `getFilterDefinition(String filterName)` Deprecated. Obtain the definition of a filter by name.
`Reference` `getReference()` Deprecated.
`SessionFactory.SessionFactoryOptions` `getSessionFactoryOptions()` Deprecated.
`Statistics` `getStatistics()` Deprecated. Retrieve the statistics fopr this factory.
`TypeHelper` `getTypeHelper()` Deprecated. Retrieve this factory's `TypeHelper`
`boolean` `isClosed()` Deprecated. Is this factory already closed?
`Session` `openSession()` Deprecated. Open a `Session`.
`StatelessSession` `openStatelessSession()` Deprecated. Open a new stateless session.
`StatelessSession` `openStatelessSession(Connection conn)` Deprecated. Open a new stateless session, utilizing the specified JDBC `Connection`.
`SessionBuilder` `withOptions()` Deprecated. Obtain a `Session` builder.
`StatelessSessionBuilder` `withStatelessOptions()` Deprecated. Obtain a `StatelessSession` builder.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getSessionFactoryOptions

    public SessionFactory.SessionFactoryOptions getSessionFactoryOptions()

  Deprecated.
  Specified by:
    `getSessionFactoryOptions` in interface `SessionFactory`

### withOptions

    public SessionBuilder withOptions()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtain a `Session` builder.

  Specified by:
    `withOptions` in interface `SessionFactory`
  Returns:
    The session builder

### openSession

    public Session openSession()
                        throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Open a `Session`.

  JDBC `connection(s` will be obtained from the configured `ConnectionProvider` as needed to perform requested work.

  Specified by:
    `openSession` in interface `SessionFactory`
  Returns:
    The created session.
  Throws:
    `HibernateException` - Indicates a problem opening the session; pretty rare here.

### getCurrentSession

    public Session getCurrentSession()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtains the current session. The definition of what exactly "current" means controlled by the `CurrentSessionContext` impl configured for use.

  Note that for backwards compatibility, if a `CurrentSessionContext` is not configured but JTA is configured this will default to the `JTASessionContext` impl.

  Specified by:
    `getCurrentSession` in interface `SessionFactory`
  Returns:
    The current session.

### getReference

    public Reference getReference()
                           throws NamingException

  Deprecated.
  Specified by:
    `getReference` in interface `Referenceable`
  Throws:
    `NamingException`
  See Also:
    `Referenceable.getReference()`

### getClassMetadata

    public ClassMetadata getClassMetadata(Class persistentClass)
                                   throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Retrieve the `ClassMetadata` associated with the given entity class.

  Specified by:
    `getClassMetadata` in interface `SessionFactory`
  Parameters:
    `persistentClass` - The entity class
  Returns:
    The metadata associated with the given entity; may be null if no such entity was mapped.
  Throws:
    `HibernateException` - Generally null is returned instead of throwing.

### getClassMetadata

    public ClassMetadata getClassMetadata(String entityName)
                                   throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Retrieve the `ClassMetadata` associated with the given entity class.

  Specified by:
    `getClassMetadata` in interface `SessionFactory`
  Parameters:
    `entityName` - The entity class
  Returns:
    The metadata associated with the given entity; may be null if no such entity was mapped.
  Throws:
    `HibernateException` - Generally null is returned instead of throwing.

### getCollectionMetadata

    public CollectionMetadata getCollectionMetadata(String roleName)
                                             throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Get the `CollectionMetadata` associated with the named collection role.

  Specified by:
    `getCollectionMetadata` in interface `SessionFactory`
  Parameters:
    `roleName` - The collection role (in form [owning-entity-name].[collection-property-name]).
  Returns:
    The metadata associated with the given collection; may be null if no such collection was mapped.
  Throws:
    `HibernateException` - Generally null is returned instead of throwing.

### getAllClassMetadata

    public Map<String,ClassMetadata> getAllClassMetadata()
                                                  throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Retrieve the `ClassMetadata` for all mapped entities.

  Specified by:
    `getAllClassMetadata` in interface `SessionFactory`
  Returns:
    A map containing all `ClassMetadata` keyed by the corresponding `String` entity-name.
  Throws:
    `HibernateException` - Generally empty map is returned instead of throwing.

### getAllCollectionMetadata

    public Map getAllCollectionMetadata()
                                 throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Get the `CollectionMetadata` for all mapped collections

  Specified by:
    `getAllCollectionMetadata` in interface `SessionFactory`
  Returns:
    a map from `String` to `CollectionMetadata`
  Throws:
    `HibernateException` - Generally empty map is returned instead of throwing.

### close

    public void close()
               throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Destroy this `SessionFactory` and release all resources (caches, connection pools, etc).

  It is the responsibility of the application to ensure that there are no open `sessions` before calling this method as the impact on those `sessions` is indeterminate.

  No-ops if already `closed`.

  Specified by:
    `close` in interface `SessionFactory`
  Throws:
    `HibernateException` - Indicates an issue closing the factory.

### isClosed

    public boolean isClosed()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Is this factory already closed?

  Specified by:
    `isClosed` in interface `SessionFactory`
  Returns:
    True if this factory is already closed; false otherwise.

### getCache

    public Cache getCache()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtain direct access to the underlying cache regions.

  Specified by:
    `getCache` in interface `SessionFactory`
  Returns:
    The direct cache access API.

### evict

    public void evict(Class persistentClass,
                      Serializable id)
               throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evict` in interface `SessionFactory`
  Parameters:
    `persistentClass` - The entity class for which to evict data.
    `id` - The entity id
  Throws:
    `HibernateException` - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

### evict

    public void evict(Class persistentClass)
               throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evict` in interface `SessionFactory`
  Parameters:
    `persistentClass` - The entity class for which to evict data.
  Throws:
    `HibernateException` - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

### evictEntity

    public void evictEntity(String entityName,
                            Serializable id)
                     throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evictEntity` in interface `SessionFactory`
  Parameters:
    `entityName` - The entity name for which to evict data.
    `id` - The entity id
  Throws:
    `HibernateException` - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

### evictEntity

    public void evictEntity(String entityName)
                     throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evictEntity` in interface `SessionFactory`
  Parameters:
    `entityName` - The entity name for which to evict data.
  Throws:
    `HibernateException` - Generally will mean that either that 'persisttentClass' did not name a mapped entity or a problem communicating with underlying cache impl.

### evictCollection

    public void evictCollection(String roleName,
                                Serializable id)
                         throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict an entry from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evictCollection` in interface `SessionFactory`
  Parameters:
    `roleName` - The name of the collection role
    `id` - The id of the collection owner
  Throws:
    `HibernateException` - Generally will mean that either that 'roleName' did not name a mapped collection or a problem communicating with underlying cache impl.

### evictCollection

    public void evictCollection(String roleName)
                         throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict all entries from the second-level cache. This method occurs outside of any transaction; it performs an immediate "hard" remove, so does not respect any transaction isolation semantics of the usage strategy. Use with care.

  Specified by:
    `evictCollection` in interface `SessionFactory`
  Parameters:
    `roleName` - The name of the collection role whose regions should be evicted
  Throws:
    `HibernateException` - Generally will mean that either that 'roleName' did not name a mapped collection or a problem communicating with underlying cache impl.

### evictQueries

    public void evictQueries()
                      throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict any query result sets cached in the default query cache region.

  Specified by:
    `evictQueries` in interface `SessionFactory`
  Throws:
    `HibernateException` - Indicate a problem communicating with underlying cache impl.

### evictQueries

    public void evictQueries(String cacheRegion)
                      throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Evict any query result sets cached in the named query cache region.

  Specified by:
    `evictQueries` in interface `SessionFactory`
  Parameters:
    `cacheRegion` - The named query cache region from which to evict.
  Throws:
    `HibernateException` - Since a not-found 'cacheRegion' simply no-ops, this should indicate a problem communicating with underlying cache impl.

### getStatistics

    public Statistics getStatistics()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Retrieve the statistics fopr this factory.

  Specified by:
    `getStatistics` in interface `SessionFactory`
  Returns:
    The statistics.

### withStatelessOptions

    public StatelessSessionBuilder withStatelessOptions()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtain a `StatelessSession` builder.

  Specified by:
    `withStatelessOptions` in interface `SessionFactory`
  Returns:
    The stateless session builder

### openStatelessSession

    public StatelessSession openStatelessSession()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Open a new stateless session.

  Specified by:
    `openStatelessSession` in interface `SessionFactory`
  Returns:
    The created stateless session.

### openStatelessSession

    public StatelessSession openStatelessSession(Connection conn)

  Deprecated.
  Description copied from interface: `SessionFactory`
  Open a new stateless session, utilizing the specified JDBC `Connection`.

  Specified by:
    `openStatelessSession` in interface `SessionFactory`
  Parameters:
    `conn` - Connection provided by the application.
  Returns:
    The created stateless session.

### getDefinedFilterNames

    public Set getDefinedFilterNames()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtain a set of the names of all filters defined on this SessionFactory.

  Specified by:
    `getDefinedFilterNames` in interface `SessionFactory`
  Returns:
    The set of filter names.

### getFilterDefinition

    public FilterDefinition getFilterDefinition(String filterName)
                                         throws HibernateException

  Deprecated.
  Description copied from interface: `SessionFactory`
  Obtain the definition of a filter by name.

  Specified by:
    `getFilterDefinition` in interface `SessionFactory`
  Parameters:
    `filterName` - The name of the filter for which to obtain the definition.
  Returns:
    The filter definition.
  Throws:
    `HibernateException` - If no filter defined with the given name.

### containsFetchProfileDefinition

    public boolean containsFetchProfileDefinition(String name)

  Deprecated.
  Description copied from interface: `SessionFactory`
  Determine if this session factory contains a fetch profile definition registered under the given name.

  Specified by:
    `containsFetchProfileDefinition` in interface `SessionFactory`
  Parameters:
    `name` - The name to check
  Returns:
    True if there is such a fetch profile; false otherwise.

### getTypeHelper

    public TypeHelper getTypeHelper()

  Deprecated.
  Description copied from interface: `SessionFactory`
  Retrieve this factory's `TypeHelper`

  Specified by:
    `getTypeHelper` in interface `SessionFactory`
  Returns:
    The factory's `TypeHelper`

Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.