public interface

SessionFactoryImplementor

implements SessionFactory Mapping
org.hibernate.engine.SessionFactoryImplementor
Known Indirect Subclasses

Class Overview

Defines the internal contract between the SessionFactory and other parts of Hibernate such as implementors of Type.

Summary

Public Methods
abstract Map getAllSecondLevelCacheRegions()
Get a map of all the second level cache regions currently maintained in this session factory.
abstract CollectionPersister getCollectionPersister(String role)
Get the persister object for a collection role.
abstract Set<String> getCollectionRolesByEntityParticipant(String entityName)
Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.
abstract ConnectionProvider getConnectionProvider()
Get the connection provider
abstract Dialect getDialect()
Get the SQL dialect.
abstract EntityNotFoundDelegate getEntityNotFoundDelegate()
abstract EntityPersister getEntityPersister(String entityName)
Get the persister for the named entity
abstract SessionFactoryObserver getFactoryObserver()
Return the SessionFactoryObserver attached to the SessionFactory if any
abstract FetchProfile getFetchProfile(String name)
Retrieve fetch profile by name.
abstract IdentifierGenerator getIdentifierGenerator(String rootEntityName)
Get the identifier generator for the hierarchy
abstract String[] getImplementors(String className)
Get the names of all persistent classes that implement/extend the given interface/class
abstract String getImportedClassName(String name)
Get a class name, using query language imports
abstract Interceptor getInterceptor()
Get the factory scoped interceptor for this factory.
abstract NamedQueryDefinition getNamedQuery(String queryName)
abstract NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
abstract Properties getProperties()
Get a copy of the Properties used to configure this session factory.
abstract QueryCache getQueryCache(String regionName)
Get a particular named query cache, or the default cache
abstract QueryCache getQueryCache()
Get the default query cache
abstract QueryPlanCache getQueryPlanCache()
abstract ResultSetMappingDefinition getResultSetMapping(String name)
abstract String[] getReturnAliases(String queryString)
Get the return aliases of a query
abstract Type[] getReturnTypes(String queryString)
Get the return types of a query
abstract SQLExceptionConverter getSQLExceptionConverter()
Retrieves the SQLExceptionConverter in effect for this SessionFactory.
abstract Region getSecondLevelCacheRegion(String regionName)
Get a named second-level cache region
abstract Settings getSettings()
abstract SQLFunctionRegistry getSqlFunctionRegistry()
abstract StatisticsImplementor getStatisticsImplementor()
Statistics SPI
abstract TransactionManager getTransactionManager()
Get the JTA transaction manager
abstract TypeResolver getTypeResolver()
Retrieve the Type resolver associated with this factory.
abstract UpdateTimestampsCache getUpdateTimestampsCache()
Get the cache of table update timestamps
abstract Session openSession(Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode)
Open a session conforming to the given parameters.
abstract Session openTemporarySession()
Get a nontransactional "current" session for Hibernate EntityManager
[Expand]
Inherited Methods
From interface javax.naming.Referenceable
From interface org.hibernate.SessionFactory
From interface org.hibernate.engine.Mapping

Public Methods

public abstract Map getAllSecondLevelCacheRegions ()

Get a map of all the second level cache regions currently maintained in this session factory. The map is structured with the region name as the key and the Region instances as the values.

Returns
  • The map of regions

public abstract CollectionPersister getCollectionPersister (String role)

Get the persister object for a collection role.

Parameters
role The role (name) of the collection for which to retrieve the persister.
Returns
  • The persister
Throws
MappingException Indicates persister could not be found with that role.

public abstract Set<String> getCollectionRolesByEntityParticipant (String entityName)

Retrieves a set of all the collection roles in which the given entity is a participant, as either an index or an element.

Parameters
entityName The entity name for which to get the collection roles.
Returns
  • set of all the collection roles in which the given entityName participates.

public abstract ConnectionProvider getConnectionProvider ()

Get the connection provider

public abstract Dialect getDialect ()

Get the SQL dialect.

Shorthand for getSettings().getDialect()

Returns
  • The dialect

public abstract EntityNotFoundDelegate getEntityNotFoundDelegate ()

public abstract EntityPersister getEntityPersister (String entityName)

Get the persister for the named entity

Parameters
entityName The name of the entity for which to retrieve the persister.
Returns
  • The persister
Throws
MappingException Indicates persister could not be found with that name.

public abstract SessionFactoryObserver getFactoryObserver ()

Return the SessionFactoryObserver attached to the SessionFactory if any

public abstract FetchProfile getFetchProfile (String name)

Retrieve fetch profile by name.

Parameters
name The name of the profile to retrieve.
Returns
  • The profile definition

public abstract IdentifierGenerator getIdentifierGenerator (String rootEntityName)

Get the identifier generator for the hierarchy

public abstract String[] getImplementors (String className)

Get the names of all persistent classes that implement/extend the given interface/class

public abstract String getImportedClassName (String name)

Get a class name, using query language imports

public abstract Interceptor getInterceptor ()

Get the factory scoped interceptor for this factory.

Returns
  • The factory scope interceptor, or null if none.

public abstract NamedQueryDefinition getNamedQuery (String queryName)

public abstract NamedSQLQueryDefinition getNamedSQLQuery (String queryName)

public abstract Properties getProperties ()

Get a copy of the Properties used to configure this session factory.

Returns
  • The properties.

public abstract QueryCache getQueryCache (String regionName)

Get a particular named query cache, or the default cache

Parameters
regionName the name of the cache region, or null for the default query cache
Returns
  • the existing cache, or a newly created cache if none by that region name

public abstract QueryCache getQueryCache ()

Get the default query cache

public abstract QueryPlanCache getQueryPlanCache ()

public abstract ResultSetMappingDefinition getResultSetMapping (String name)

public abstract String[] getReturnAliases (String queryString)

Get the return aliases of a query

public abstract Type[] getReturnTypes (String queryString)

Get the return types of a query

public abstract SQLExceptionConverter getSQLExceptionConverter ()

Retrieves the SQLExceptionConverter in effect for this SessionFactory.

Returns
  • The SQLExceptionConverter for this SessionFactory.

public abstract Region getSecondLevelCacheRegion (String regionName)

Get a named second-level cache region

Parameters
regionName The name of the region to retrieve.
Returns
  • The region

public abstract Settings getSettings ()

public abstract SQLFunctionRegistry getSqlFunctionRegistry ()

public abstract StatisticsImplementor getStatisticsImplementor ()

Statistics SPI

public abstract TransactionManager getTransactionManager ()

Get the JTA transaction manager

public abstract TypeResolver getTypeResolver ()

Retrieve the Type resolver associated with this factory.

Returns
  • The type resolver

public abstract UpdateTimestampsCache getUpdateTimestampsCache ()

Get the cache of table update timestamps

public abstract Session openSession (Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode)

Open a session conforming to the given parameters. Used mainly by JTASessionContext for current session processing.

Parameters
connection The external jdbc connection to use, if one (i.e., optional).
flushBeforeCompletionEnabled Should the session be auto-flushed prior to transaction completion?
autoCloseSessionEnabled Should the session be auto-closed after transaction completion?
connectionReleaseMode The release mode for managed jdbc connections.
Returns
  • An appropriate session.

public abstract Session openTemporarySession ()

Get a nontransactional "current" session for Hibernate EntityManager