Session instances. Usually
an application has a single SessionFactory instance and threads
servicing client requests obtain Session instances from this factory.
The internal state of a SessionFactory is immutable. Once it is created
this internal state is set. This internal state includes all of the metadata
about Object/Relational Mapping.
Implementors must be threadsafe.
org.hibernate.cfg.Configuration
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | Returns: True if there is such a fetch profile; false otherwise.The name to check name)Determine if this session factory contains a fetch profile definition registered under the given name. |
| public void | evict(Class<T>
The entity class for which to evict data. persistentClass)
Deprecated
Use
Evict all entries from the second-level cache.
Cache#evictEntityRegion(Class) accessed through
getCache() instead.
|
| public void | evict(Class<T>
The entity class for which to evict data. persistentClass, Serializable The entity id id)
Deprecated
Use
Evict an entry from the second-level cache.
Cache#containsEntity(Class, Serializable) accessed through
getCache() instead.
|
| public void | evictCollection(String
The name of the collection role whose regions should be evicted roleName)
Deprecated
Use
Evict all entries from the second-level cache.
Cache#evictCollectionRegion(String) accessed through
getCache() instead.
|
| public void | evictCollection(String
The name of the collection role roleName, Serializable The id of the collection owner id)
Deprecated
Use
Evict an entry from the second-level cache.
Cache#evictCollection(String, Serializable) accessed through
getCache() instead.
|
| public void | evictEntity(String
The entity name for which to evict data. entityName)
Deprecated
Use
Evict all entries from the second-level cache.
Cache#evictEntityRegion(String) accessed through
getCache() instead.
|
| public void | evictEntity(String
The entity name for which to evict data. entityName, Serializable The entity id id)
Deprecated
Use
Evict an entry from the second-level cache.
Cache#evictEntity(String, Serializable) accessed through
getCache() instead.
|
| public void | evictQueries(String
The named query cache region from which to evict. cacheRegion)
Deprecated
Use
Evict any query result sets cached in the named query cache region.
Cache#evictQueryRegion(String) accessed through
getCache() instead.
|
| public void | evictQueries()
Deprecated
Use
Evict any query result sets cached in the default query cache region.
Cache#evictQueryRegions accessed through
getCache() instead.
|
| public Map | |
| public Map | Returns: a map from String to CollectionMetadataGet the |
| public Cache | Returns: The direct cache access API.Obtain direct access to the underlying cache regions. |
| public ClassMetadata | Returns: The metadata associated with the given entity; may be null if no such entity was mapped.The entity class entityClass)Retrieve the |
| public ClassMetadata | Returns: The metadata associated with the given entity; may be null if no such entity was mapped.The entity class entityName)Retrieve the |
| public CollectionMetadata | Returns: The metadata associated with the given collection; may be null if no such collection was mapped.The collection role (in form [owning-entity-name].[collection-property-name]). roleName)Get the |
| public Session | |
| public Set | Returns: The set of filter names.Obtain a set of the names of all filters defined on this SessionFactory. |
| public FilterDefinition | Returns: The filter definition.The name of the filter for which to obtain the definition. filterName)Obtain the definition of a filter by name. |
| public Statistics | |
| public TypeHelper | |
| public boolean | Returns: True if this factory is already closed; false otherwise.Is this factory already closed? |
| public Session | |
| public Session | Returns: The created session.a session-scoped interceptor interceptor)Open a |
| public Session | Returns: The created session.a connection provided by the application. connection)Open a |
| public Session | Returns: The created session.a connection provided by the application. connection, Interceptor a session-scoped interceptor interceptor)Open a |
| public StatelessSession | |
| public StatelessSession | Returns: The created stateless session.Connection provided by the application. connection)Open a new stateless session, utilizing the specified JDBC
|
| close | back to summary |
|---|---|
| public void close() throws HibernateException 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
No-ops if already
| |
| containsFetchProfileDefinition | back to summary |
|---|---|
| public boolean containsFetchProfileDefinition(String name) Determine if this session factory contains a fetch profile definition registered under the given name.
| |
| evict | back to summary |
|---|---|
| public void evict(Class<T> persistentClass) throws HibernateException
Deprecated Use 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.
| |
| evict | back to summary |
|---|---|
| public void evict(Class<T> persistentClass, Serializable id) throws HibernateException
Deprecated Use 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.
| |
| evictCollection | back to summary |
|---|---|
| public void evictCollection(String roleName) throws HibernateException
Deprecated Use 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.
| |
| evictCollection | back to summary |
|---|---|
| public void evictCollection(String roleName, Serializable id) throws HibernateException
Deprecated Use 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.
| |
| evictEntity | back to summary |
|---|---|
| public void evictEntity(String entityName) throws HibernateException
Deprecated Use 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.
| |
| evictEntity | back to summary |
|---|---|
| public void evictEntity(String entityName, Serializable id) throws HibernateException
Deprecated Use 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.
| |
| evictQueries | back to summary |
|---|---|
| public void evictQueries(String cacheRegion) throws HibernateException
Deprecated Use Evict any query result sets cached in the named query cache region.
| |
| evictQueries | back to summary |
|---|---|
| public void evictQueries() throws HibernateException
Deprecated Use Evict any query result sets cached in the default query cache region.
| |
| getAllClassMetadata | back to summary |
|---|---|
| public Map Retrieve the
| |
| getAllCollectionMetadata | back to summary |
|---|---|
| public Map Get the
| |
| getCache | back to summary |
|---|---|
| public Cache getCache() Obtain direct access to the underlying cache regions.
| |
| getClassMetadata | back to summary |
|---|---|
| public ClassMetadata getClassMetadata(Class<T> entityClass) Retrieve the
| |
| getClassMetadata | back to summary |
|---|---|
| public ClassMetadata getClassMetadata(String entityName) Retrieve the
| |
| getCollectionMetadata | back to summary |
|---|---|
| public CollectionMetadata getCollectionMetadata(String roleName) Get the
| |
| getCurrentSession | back to summary |
|---|---|
| public Session getCurrentSession() throws HibernateException Obtains the current session. The definition of what exactly "current"
means controlled by the
Note that for backwards compatibility, if a
| |
| getDefinedFilterNames | back to summary |
|---|---|
| public Set Obtain a set of the names of all filters defined on this SessionFactory.
| |
| getFilterDefinition | back to summary |
|---|---|
| public FilterDefinition getFilterDefinition(String filterName) throws HibernateException Obtain the definition of a filter by name.
| |
| getStatistics | back to summary |
|---|---|
| public Statistics getStatistics() Retrieve the statistics fopr this factory.
| |
| getTypeHelper | back to summary |
|---|---|
| public TypeHelper getTypeHelper() Retrieve this factory's
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Is this factory already closed?
| |
| openSession | back to summary |
|---|---|
| public Session openSession() throws HibernateException Open a
JDBC
| |
| openSession | back to summary |
|---|---|
| public Session openSession(Interceptor interceptor) throws HibernateException Open a
JDBC
| |
| openSession | back to summary |
|---|---|
| public Session openSession(Connection connection) Open a
Note that the second-level cache will be disabled if you supply a JDBC
connection. Hibernate will not be able to track any statements you might
have executed in the same transaction. Consider implementing your own
| |
| openSession | back to summary |
|---|---|
| public Session openSession(Connection connection, Interceptor interceptor) Open a
Note that the second-level cache will be disabled if you supply a JDBC
connection. Hibernate will not be able to track any statements you might
have executed in the same transaction. Consider implementing your own
| |
| openStatelessSession | back to summary |
|---|---|
| public StatelessSession openStatelessSession() Open a new stateless session.
| |
| openStatelessSession | back to summary |
|---|---|
| public StatelessSession openStatelessSession(Connection connection) Open a new stateless session, utilizing the specified JDBC
| |