Top Description Methods
org.hibernate.engine

public Interface SessionFactoryImplementor

extends Mapping, SessionFactory
Known Direct Implementers
org.hibernate.impl.SessionFactoryImpl
Imports
java.util.Map, .Properties, .Set, java.sql.Connection, javax.transaction.TransactionManager, org.hibernate.HibernateException, .Interceptor, .MappingException, .SessionFactory, .ConnectionReleaseMode, .SessionFactoryObserver, org.hibernate.proxy.EntityNotFoundDelegate, org.hibernate.engine.query.QueryPlanCache, org.hibernate.engine.profile.FetchProfile, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, org.hibernate.cache.QueryCache, .UpdateTimestampsCache, .Region, org.hibernate.cfg.Settings, org.hibernate.connection.ConnectionProvider, org.hibernate.dialect.Dialect, org.hibernate.dialect.function.SQLFunctionRegistry, org.hibernate.exception.SQLExceptionConverter, org.hibernate.id.IdentifierGenerator, org.hibernate.stat.StatisticsImplementor, org.hibernate.type.Type, .TypeResolver

Defines the internal contract between the SessionFactory and other parts of Hibernate such as implementors of Type.
Author
Gavin King
See Also
org.hibernate.SessionFactory, org.hibernate.impl.SessionFactoryImpl

Method Summary

Modifier and TypeMethod and Description
public Map<K, V>

Returns:

The map of regions
getAllSecondLevelCacheRegions
()

Get a map of all the second level cache regions currently maintained in this session factory.

public CollectionPersister

Returns:

The persister
getCollectionPersister
(String
The role (name) of the collection for which to retrieve the persister.
role
)

Get the persister object for a collection role.

public Set<String>

Returns:

set of all the collection roles in which the given entityName participates.
getCollectionRolesByEntityParticipant
(String
The entity name for which to get the collection roles.
entityName
)

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

public ConnectionProvider
getConnectionProvider()

Get the connection provider

public Dialect

Returns:

The dialect
getDialect
()

Get the SQL dialect.

public EntityNotFoundDelegate
public EntityPersister

Returns:

The persister
getEntityPersister
(String
The name of the entity for which to retrieve the persister.
entityName
)

Get the persister for the named entity

public SessionFactoryObserver
getFactoryObserver()

Return the SessionFactoryObserver attached to the SessionFactory if any

public FetchProfile

Returns:

The profile definition
getFetchProfile
(String
The name of the profile to retrieve.
name
)

Retrieve fetch profile by name.

public IdentifierGenerator
getIdentifierGenerator(String rootEntityName)

Get the identifier generator for the hierarchy

public String[]
getImplementors(String className)

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

public String
getImportedClassName(String name)

Get a class name, using query language imports

public Interceptor

Returns:

The factory scope interceptor, or null if none.
getInterceptor
()

Get the factory scoped interceptor for this factory.

public NamedQueryDefinition
getNamedQuery(String queryName)

public NamedSQLQueryDefinition
public Properties

Returns:

The properties.
getProperties
()

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

public QueryCache
getQueryCache()

Get the default query cache

public QueryCache

Returns:

the existing cache, or a newly created cache if none by that region name
getQueryCache
(String
the name of the cache region, or null for the default query cache
regionName
)

Get a particular named query cache, or the default cache

public QueryPlanCache
public ResultSetMappingDefinition
public String[]
getReturnAliases(String queryString)

Get the return aliases of a query

public Type[]
getReturnTypes(String queryString)

Get the return types of a query

public Region

Returns:

The region
getSecondLevelCacheRegion
(String
The name of the region to retrieve.
regionName
)

Get a named second-level cache region

public Settings
public SQLExceptionConverter

Returns:

The SQLExceptionConverter for this SessionFactory.
getSQLExceptionConverter
()

Retrieves the SQLExceptionConverter in effect for this SessionFactory.

public SQLFunctionRegistry
public StatisticsImplementor
getStatisticsImplementor()

Statistics SPI

public TransactionManager
getTransactionManager()

Get the JTA transaction manager

public TypeResolver

Returns:

The type resolver
getTypeResolver
()

Retrieve the Type resolver associated with this factory.

public UpdateTimestampsCache
getUpdateTimestampsCache()

Get the cache of table update timestamps

public Session

Returns:

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

Open a session conforming to the given parameters.

public Session
openTemporarySession()

Get a nontransactional "current" session for Hibernate EntityManager

Inherited from org.hibernate.engine.Mapping:
getIdentifierGeneratorFactorygetIdentifierPropertyNamegetIdentifierTypegetReferencedPropertyType
Inherited from org.hibernate.SessionFactory:
closecontainsFetchProfileDefinitionevictevictevictCollectionevictCollectionevictEntityevictEntityevictQueriesevictQueriesgetAllClassMetadatagetAllCollectionMetadatagetCachegetClassMetadatagetClassMetadatagetCollectionMetadatagetCurrentSessiongetDefinedFilterNamesgetFilterDefinitiongetStatisticsgetTypeHelperisClosedopenSessionopenSessionopenSessionopenSessionopenStatelessSessionopenStatelessSession

Method Detail

getAllSecondLevelCacheRegionsback to summary
public Map<K, V> 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:Map<K, V>

The map of regions

getCollectionPersisterback to summary
public CollectionPersister getCollectionPersister(String role) throws MappingException

Get the persister object for a collection role.

Parameters
role:String

The role (name) of the collection for which to retrieve the persister.

Returns:CollectionPersister

The persister

Exceptions
MappingException:
Indicates persister could not be found with that role.
getCollectionRolesByEntityParticipantback to summary
public 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:String

The entity name for which to get the collection roles.

Returns:Set<String>

set of all the collection roles in which the given entityName participates.

getConnectionProviderback to summary
public ConnectionProvider getConnectionProvider()

Get the connection provider

getDialectback to summary
public Dialect getDialect()

Get the SQL dialect.

Shorthand for getSettings().Settings#getDialect()

Returns:Dialect

The dialect

getEntityNotFoundDelegateback to summary
public EntityNotFoundDelegate getEntityNotFoundDelegate()
getEntityPersisterback to summary
public EntityPersister getEntityPersister(String entityName) throws MappingException

Get the persister for the named entity

Parameters
entityName:String

The name of the entity for which to retrieve the persister.

Returns:EntityPersister

The persister

Exceptions
MappingException:
Indicates persister could not be found with that name.
getFactoryObserverback to summary
public SessionFactoryObserver getFactoryObserver()

Return the SessionFactoryObserver attached to the SessionFactory if any

getFetchProfileback to summary
public FetchProfile getFetchProfile(String name)

Retrieve fetch profile by name.

Parameters
name:String

The name of the profile to retrieve.

Returns:FetchProfile

The profile definition

getIdentifierGeneratorback to summary
public IdentifierGenerator getIdentifierGenerator(String rootEntityName)

Get the identifier generator for the hierarchy

getImplementorsback to summary
public String[] getImplementors(String className) throws MappingException

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

getImportedClassNameback to summary
public String getImportedClassName(String name)

Get a class name, using query language imports

getInterceptorback to summary
public Interceptor getInterceptor()

Get the factory scoped interceptor for this factory.

Returns:Interceptor

The factory scope interceptor, or null if none.

getNamedQueryback to summary
public NamedQueryDefinition getNamedQuery(String queryName)
getNamedSQLQueryback to summary
public NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
getPropertiesback to summary
public Properties getProperties()

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

Returns:Properties

The properties.

getQueryCacheback to summary
public QueryCache getQueryCache()

Get the default query cache

getQueryCacheback to summary
public QueryCache getQueryCache(String regionName) throws HibernateException

Get a particular named query cache, or the default cache

Parameters
regionName:String

the name of the cache region, or null for the default query cache

Returns:QueryCache

the existing cache, or a newly created cache if none by that region name

getQueryPlanCacheback to summary
public QueryPlanCache getQueryPlanCache()
getResultSetMappingback to summary
public ResultSetMappingDefinition getResultSetMapping(String name)
getReturnAliasesback to summary
public String[] getReturnAliases(String queryString) throws HibernateException

Get the return aliases of a query

getReturnTypesback to summary
public Type[] getReturnTypes(String queryString) throws HibernateException

Get the return types of a query

getSecondLevelCacheRegionback to summary
public Region getSecondLevelCacheRegion(String regionName)

Get a named second-level cache region

Parameters
regionName:String

The name of the region to retrieve.

Returns:Region

The region

getSettingsback to summary
public Settings getSettings()
getSQLExceptionConverterback to summary
public SQLExceptionConverter getSQLExceptionConverter()

Retrieves the SQLExceptionConverter in effect for this SessionFactory.

Returns:SQLExceptionConverter

The SQLExceptionConverter for this SessionFactory.

getSqlFunctionRegistryback to summary
public SQLFunctionRegistry getSqlFunctionRegistry()
getStatisticsImplementorback to summary
public StatisticsImplementor getStatisticsImplementor()

Statistics SPI

getTransactionManagerback to summary
public TransactionManager getTransactionManager()

Get the JTA transaction manager

getTypeResolverback to summary
public TypeResolver getTypeResolver()

Retrieve the Type resolver associated with this factory.

Returns:TypeResolver

The type resolver

getUpdateTimestampsCacheback to summary
public UpdateTimestampsCache getUpdateTimestampsCache()

Get the cache of table update timestamps

openSessionback to summary
public Session openSession(final Connection connection, final boolean flushBeforeCompletionEnabled, final boolean autoCloseSessionEnabled, final ConnectionReleaseMode connectionReleaseMode) throws HibernateException

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

Parameters
connection:Connection

The external jdbc connection to use, if one (i.e., optional).

flushBeforeCompletionEnabled:boolean

Should the session be auto-flushed prior to transaction completion?

autoCloseSessionEnabled:boolean

Should the session be auto-closed after transaction completion?

connectionReleaseMode:ConnectionReleaseMode

The release mode for managed jdbc connections.

Returns:Session

An appropriate session.

openTemporarySessionback to summary
public Session openTemporarySession() throws HibernateException

Get a nontransactional "current" session for Hibernate EntityManager