public class SessionFactoryDelegatingImpl extends Object implements SessionFactoryImplementor, SessionFactory
Base delegating implementation of the SessionFactory and SessionFactoryImplementor contracts for intended for easier implementation of SessionFactory.
SessionFactoryImplementor.DeserializationResolver<T extends SessionFactoryImplementor>| Constructor and Description |
|---|
SessionFactoryDelegatingImpl(SessionFactoryImplementor delegate) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityManagerFactoryName, getEntityTypeByName, getSessionFactorypublic SessionFactoryDelegatingImpl(SessionFactoryImplementor delegate)
protected SessionFactoryImplementor delegate()
public SessionFactoryOptions getSessionFactoryOptions()
SessionFactoryGet the special options used to build the factory.
getSessionFactoryOptions in interface SessionFactorypublic SessionBuilderImplementor withOptions()
SessionFactoryObtain a Session builder.
withOptions in interface SessionFactoryImplementorwithOptions in interface SessionFactorypublic Session openSession() throws HibernateException
SessionFactoryOpen a Session.
<p/>
JDBC connection(s will be obtained from the
configured ConnectionProvider as needed
to perform requested work.
openSession in interface SessionFactoryHibernateException - Indicates a problem opening the session; pretty rare here.public Session getCurrentSession() throws HibernateException
SessionFactoryObtains the current session. The definition of what exactly "current"
means controlled by the CurrentSessionContext impl configured
for use.
<p/>
Note that for backwards compatibility, if a CurrentSessionContext
is not configured but JTA is configured this will default to the org.hibernate.context.internal.JTASessionContext
impl.
getCurrentSession in interface SessionFactoryHibernateException - Indicates an issue locating a suitable current session.public StatelessSessionBuilder withStatelessOptions()
SessionFactoryObtain a StatelessSession builder.
withStatelessOptions in interface SessionFactorypublic StatelessSession openStatelessSession()
SessionFactoryOpen a new stateless session.
openStatelessSession in interface SessionFactorypublic StatelessSession openStatelessSession(Connection connection)
SessionFactoryOpen a new stateless session, utilizing the specified JDBC
Connection.
openStatelessSession in interface SessionFactoryconnection - Connection provided by the application.public ClassMetadata getClassMetadata(Class entityClass)
SessionFactoryRetrieve the ClassMetadata associated with the given entity class.
getClassMetadata in interface SessionFactoryentityClass - The entity classpublic ClassMetadata getClassMetadata(String entityName)
SessionFactoryRetrieve the ClassMetadata associated with the given entity class.
getClassMetadata in interface SessionFactoryentityName - The entity classpublic CollectionMetadata getCollectionMetadata(String roleName)
SessionFactoryGet the CollectionMetadata associated with the named collection role.
getCollectionMetadata in interface SessionFactoryroleName - The collection role (in form [owning-entity-name].[collection-property-name]).public Map<String,ClassMetadata> getAllClassMetadata()
SessionFactoryRetrieve the ClassMetadata for all mapped entities.
getAllClassMetadata in interface SessionFactoryClassMetadata keyed by the
corresponding String entity-name.public Map getAllCollectionMetadata()
SessionFactoryGet the CollectionMetadata for all mapped collections.
getAllCollectionMetadata in interface SessionFactorypublic StatisticsImplementor getStatistics()
SessionFactoryRetrieve the statistics fopr this factory.
getStatistics in interface SessionFactoryImplementorgetStatistics in interface SessionFactorypublic void close()
throws HibernateException
SessionFactoryDestroy this <tt>SessionFactory</tt> and release all resources (caches,
connection pools, etc).
<p/>
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.
<p/>
No-ops if already closed.
close in interface Closeableclose in interface AutoCloseableclose in interface EntityManagerFactoryclose in interface SessionFactoryHibernateException - Indicates an issue closing the factory.public boolean isClosed()
SessionFactoryIs this factory already closed?
isClosed in interface SessionFactorypublic CacheImplementor getCache()
SessionFactoryObtain direct access to the underlying cache regions.
getCache in interface EntityManagerFactorygetCache in interface SessionFactoryImplementorgetCache in interface SessionFactorypublic PersistenceUnitUtil getPersistenceUnitUtil()
getPersistenceUnitUtil in interface EntityManagerFactorypublic void addNamedQuery(String name, Query query)
addNamedQuery in interface EntityManagerFactorypublic <T> T unwrap(Class<T> cls)
unwrap in interface EntityManagerFactorypublic <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph)
addNamedEntityGraph in interface EntityManagerFactorypublic Set getDefinedFilterNames()
SessionFactoryObtain a set of the names of all filters defined on this SessionFactory.
getDefinedFilterNames in interface SessionFactorypublic FilterDefinition getFilterDefinition(String filterName) throws HibernateException
SessionFactoryObtain the definition of a filter by name.
getFilterDefinition in interface SessionFactoryfilterName - The name of the filter for which to obtain the definition.HibernateException - If no filter defined with the given name.public boolean containsFetchProfileDefinition(String name)
SessionFactoryDetermine if this session factory contains a fetch profile definition registered under the given name.
containsFetchProfileDefinition in interface SessionFactoryname - The name to checkpublic TypeHelper getTypeHelper()
SessionFactoryRetrieve this factory’s TypeHelper.
getTypeHelper in interface SessionFactoryTypeHelper@Deprecated public TypeResolver getTypeResolver()
Retrieve the Type resolver associated with this factory.
getTypeResolver in interface SessionFactoryImplementorpublic Map<String,Object> getProperties()
getProperties in interface EntityManagerFactorypublic EntityPersister getEntityPersister(String entityName) throws MappingException
getEntityPersister in interface SessionFactoryImplementorMappingExceptionpublic Map<String,EntityPersister> getEntityPersisters()
getEntityPersisters in interface SessionFactoryImplementorpublic CollectionPersister getCollectionPersister(String role) throws MappingException
getCollectionPersister in interface SessionFactoryImplementorMappingExceptionpublic Map<String,CollectionPersister> getCollectionPersisters()
getCollectionPersisters in interface SessionFactoryImplementorpublic JdbcServices getJdbcServices()
SessionFactoryImplementorGet the JdbcServices.
getJdbcServices in interface SessionFactoryImplementorpublic Dialect getDialect()
SessionFactoryImplementorGet the SQL dialect.
<p/>
Shorthand for getJdbcServices().getDialect()
getDialect in interface SessionFactoryImplementorpublic Interceptor getInterceptor()
SessionFactoryImplementorGet the factory scoped interceptor for this factory.
getInterceptor in interface SessionFactoryImplementorpublic QueryPlanCache getQueryPlanCache()
SessionFactoryImplementorAccess to the cachres of HQL/JPQL and native query plans.
getQueryPlanCache in interface SessionFactoryImplementorpublic Type[] getReturnTypes(String queryString) throws HibernateException
SessionFactoryImplementorGet the return types of a query
getReturnTypes in interface SessionFactoryImplementorHibernateExceptionpublic String[] getReturnAliases(String queryString) throws HibernateException
SessionFactoryImplementorGet the return aliases of a query
getReturnAliases in interface SessionFactoryImplementorHibernateExceptionpublic String[] getImplementors(String className) throws MappingException
SessionFactoryImplementorGet the names of all persistent classes that implement/extend the given interface/class
getImplementors in interface SessionFactoryImplementorMappingExceptionpublic String getImportedClassName(String name)
SessionFactoryImplementorGet a class name, using query language imports
getImportedClassName in interface SessionFactoryImplementorpublic EntityGraph findEntityGraphByName(String name)
findEntityGraphByName in interface SessionFactoryImplementorpublic StatisticsImplementor getStatisticsImplementor()
getStatisticsImplementor in interface SessionFactoryImplementorpublic NamedQueryDefinition getNamedQuery(String queryName)
getNamedQuery in interface SessionFactoryImplementorpublic void registerNamedQueryDefinition(String name, NamedQueryDefinition definition)
registerNamedQueryDefinition in interface SessionFactoryImplementorpublic NamedSQLQueryDefinition getNamedSQLQuery(String queryName)
getNamedSQLQuery in interface SessionFactoryImplementorpublic void registerNamedSQLQueryDefinition(String name, NamedSQLQueryDefinition definition)
registerNamedSQLQueryDefinition in interface SessionFactoryImplementorpublic ResultSetMappingDefinition getResultSetMapping(String name)
getResultSetMapping in interface SessionFactoryImplementorpublic IdentifierGenerator getIdentifierGenerator(String rootEntityName)
SessionFactoryImplementorGet the identifier generator for the hierarchy
getIdentifierGenerator in interface SessionFactoryImplementorpublic SQLExceptionConverter getSQLExceptionConverter()
SessionFactoryImplementorRetrieves the SQLExceptionConverter in effect for this SessionFactory.
getSQLExceptionConverter in interface SessionFactoryImplementorpublic SqlExceptionHelper getSQLExceptionHelper()
SessionFactoryImplementorRetrieves the SqlExceptionHelper in effect for this SessionFactory.
getSQLExceptionHelper in interface SessionFactoryImplementorpublic Settings getSettings()
getSettings in interface SessionFactoryImplementorpublic Session openTemporarySession() throws HibernateException
SessionFactoryImplementorGet a non-transactional "current" session (used by hibernate-envers)
openTemporarySession in interface SessionFactoryImplementorHibernateExceptionpublic Set<String> getCollectionRolesByEntityParticipant(String entityName)
getCollectionRolesByEntityParticipant in interface SessionFactoryImplementorentityName - The entity name for which to get the collection roles.public EntityNotFoundDelegate getEntityNotFoundDelegate()
getEntityNotFoundDelegate in interface SessionFactoryImplementorpublic SQLFunctionRegistry getSqlFunctionRegistry()
getSqlFunctionRegistry in interface SessionFactoryImplementorpublic FetchProfile getFetchProfile(String name)
SessionFactoryImplementorRetrieve fetch profile by name.
getFetchProfile in interface SessionFactoryImplementorname - The name of the profile to retrieve.public ServiceRegistryImplementor getServiceRegistry()
SessionFactoryImplementorAccess to the ServiceRegistry for this SessionFactory.
getServiceRegistry in interface SessionFactoryImplementorpublic void addObserver(SessionFactoryObserver observer)
addObserver in interface SessionFactoryImplementorpublic CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
getCustomEntityDirtinessStrategy in interface SessionFactoryImplementorpublic CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
getCurrentTenantIdentifierResolver in interface SessionFactoryImplementorpublic NamedQueryRepository getNamedQueryRepository()
SessionFactoryImplementorProvides access to the named query repository
getNamedQueryRepository in interface SessionFactoryImplementorpublic Iterable<EntityNameResolver> iterateEntityNameResolvers()
iterateEntityNameResolvers in interface SessionFactoryImplementorpublic EntityPersister locateEntityPersister(Class byClass)
locateEntityPersister in interface SessionFactoryImplementorpublic EntityPersister locateEntityPersister(String byName)
locateEntityPersister in interface SessionFactoryImplementorpublic SessionFactoryImplementor.DeserializationResolver getDeserializationResolver()
getDeserializationResolver in interface SessionFactoryImplementorpublic IdentifierGeneratorFactory getIdentifierGeneratorFactory()
MappingAllow access to the id generator factory, though this is only needed/allowed from configuration.
getIdentifierGeneratorFactory in interface Mappingpublic Type getIdentifierType(String className) throws MappingException
getIdentifierType in interface MappingMappingExceptionpublic String getIdentifierPropertyName(String className) throws MappingException
getIdentifierPropertyName in interface MappingMappingExceptionpublic Type getReferencedPropertyType(String className, String propertyName) throws MappingException
getReferencedPropertyType in interface MappingMappingExceptionpublic String getUuid()
SessionFactoryImplementorGet the UUID for this SessionFactory. The value is generated as a UUID, but kept
as a String.
getUuid in interface SessionFactoryImplementorSessionFactoryRegistry.getSessionFactory(java.lang.String)public String getName()
SessionFactoryImplementorAccess to the name (if one) assigned to the SessionFactory
getName in interface SessionFactoryImplementorpublic Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionpublic <T> List<EntityGraph<? super T>> findEntityGraphsByType(Class<T> entityClass)
HibernateEntityManagerFactoryFind all EntityGraphs associated with a given entity type.
findEntityGraphsByType in interface HibernateEntityManagerFactoryentityClass - the entity type for which to find all EntityGraphs.EntityGraph instances associated with the given entity type. The empty list is
returned in case there are not entity graphs.public EntityManager createEntityManager()
createEntityManager in interface EntityManagerFactorypublic EntityManager createEntityManager(Map map)
createEntityManager in interface EntityManagerFactorypublic EntityManager createEntityManager(SynchronizationType synchronizationType)
createEntityManager in interface EntityManagerFactorypublic EntityManager createEntityManager(SynchronizationType synchronizationType, Map map)
createEntityManager in interface EntityManagerFactorypublic CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface EntityManagerFactorypublic MetamodelImplementor getMetamodel()
getMetamodel in interface EntityManagerFactorygetMetamodel in interface SessionFactoryImplementorgetMetamodel in interface HibernateEntityManagerFactorypublic boolean isOpen()
isOpen in interface EntityManagerFactorypublic Type resolveParameterBindType(Object bindValue)
resolveParameterBindType in interface QueryParameterBindingTypeResolverpublic Type resolveParameterBindType(Class clazz)
resolveParameterBindType in interface QueryParameterBindingTypeResolverCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.