Package org.hibernate.engine
Interface SessionFactoryImplementor
- All Superinterfaces:
Mapping,Referenceable,Serializable,SessionFactory
- All Known Implementing Classes:
SessionFactoryImpl
Defines the internal contract between the SessionFactory and other parts of
Hibernate such as implementors of Type.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet a map of all the second level cache regions currently maintained in this session factory.getCollectionPersister(String role) Get the persister object for a collection role.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.Get the connection providerGet the SQL dialect.getEntityPersister(String entityName) Get the persister for the named entityReturn the SessionFactoryObserver attached to the SessionFactory if anygetFetchProfile(String name) Retrieve fetch profile by name.getIdentifierGenerator(String rootEntityName) Get the identifier generator for the hierarchyString[]getImplementors(String className) Get the names of all persistent classes that implement/extend the given interface/classgetImportedClassName(String name) Get a class name, using query language importsGet the factory scoped interceptor for this factory.getNamedQuery(String queryName) getNamedSQLQuery(String queryName) Get a copy of the Properties used to configure this session factory.Get the default query cachegetQueryCache(String regionName) Get a particular named query cache, or the default cachegetResultSetMapping(String name) String[]getReturnAliases(String queryString) Get the return aliases of a queryType[]getReturnTypes(String queryString) Get the return types of a querygetSecondLevelCacheRegion(String regionName) Get a named second-level cache regionRetrieves the SQLExceptionConverter in effect for this SessionFactory.Statistics SPIGet the JTA transaction managerRetrieve theTyperesolver associated with this factory.Get the cache of table update timestampsopenSession(Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode) Open a session conforming to the given parameters.Get a nontransactional "current" session for Hibernate EntityManagerMethods inherited from interface org.hibernate.engine.Mapping
getIdentifierGeneratorFactory, getIdentifierPropertyName, getIdentifierType, getReferencedPropertyTypeMethods inherited from interface javax.naming.Referenceable
getReferenceMethods inherited from interface org.hibernate.SessionFactory
close, containsFetchProfileDefinition, evict, evict, evictCollection, evictCollection, evictEntity, evictEntity, evictQueries, evictQueries, getAllClassMetadata, getAllCollectionMetadata, getCache, getClassMetadata, getClassMetadata, getCollectionMetadata, getCurrentSession, getDefinedFilterNames, getFilterDefinition, getStatistics, getTypeHelper, isClosed, openSession, openSession, openSession, openSession, openStatelessSession, openStatelessSession
-
Method Details
-
getTypeResolver
TypeResolver getTypeResolver()Retrieve theTyperesolver associated with this factory.- Returns:
- The type resolver
-
getProperties
Properties getProperties()Get a copy of the Properties used to configure this session factory.- Returns:
- The properties.
-
getEntityPersister
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.
-
getCollectionPersister
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.
-
getDialect
Dialect getDialect()Get the SQL dialect. Shorthand forgetSettings().Settings.getDialect()- Returns:
- The dialect
-
getInterceptor
Interceptor getInterceptor()Get the factory scoped interceptor for this factory.- Returns:
- The factory scope interceptor, or null if none.
-
getQueryPlanCache
QueryPlanCache getQueryPlanCache() -
getReturnTypes
Get the return types of a query- Throws:
HibernateException
-
getReturnAliases
Get the return aliases of a query- Throws:
HibernateException
-
getConnectionProvider
ConnectionProvider getConnectionProvider()Get the connection provider -
getImplementors
Get the names of all persistent classes that implement/extend the given interface/class- Throws:
MappingException
-
getImportedClassName
Get a class name, using query language imports -
getTransactionManager
TransactionManager getTransactionManager()Get the JTA transaction manager -
getQueryCache
QueryCache getQueryCache()Get the default query cache -
getQueryCache
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
- Throws:
HibernateException
-
getUpdateTimestampsCache
UpdateTimestampsCache getUpdateTimestampsCache()Get the cache of table update timestamps -
getStatisticsImplementor
StatisticsImplementor getStatisticsImplementor()Statistics SPI -
getNamedQuery
-
getNamedSQLQuery
-
getResultSetMapping
-
getIdentifierGenerator
Get the identifier generator for the hierarchy -
getSecondLevelCacheRegion
Get a named second-level cache region- Parameters:
regionName- The name of the region to retrieve.- Returns:
- The region
-
getAllSecondLevelCacheRegions
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 theRegioninstances as the values.- Returns:
- The map of regions
-
getSQLExceptionConverter
SQLExceptionConverter getSQLExceptionConverter()Retrieves the SQLExceptionConverter in effect for this SessionFactory.- Returns:
- The SQLExceptionConverter for this SessionFactory.
-
getSettings
Settings getSettings() -
openTemporarySession
Get a nontransactional "current" session for Hibernate EntityManager- Throws:
HibernateException
-
openSession
Session openSession(Connection connection, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, ConnectionReleaseMode connectionReleaseMode) throws HibernateException Open a session conforming to the given parameters. Used mainly byJTASessionContextfor 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.
- Throws:
HibernateException
-
getCollectionRolesByEntityParticipant
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.
-
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate() -
getSqlFunctionRegistry
SQLFunctionRegistry getSqlFunctionRegistry() -
getFetchProfile
Retrieve fetch profile by name.- Parameters:
name- The name of the profile to retrieve.- Returns:
- The profile definition
-
getFactoryObserver
SessionFactoryObserver getFactoryObserver()Return the SessionFactoryObserver attached to the SessionFactory if any- Returns:
-