Deprecated
as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.
SessionFactory API.
Exposes two interfaces:
SessionFactory to the application, and
SessionImplementor (an SPI interface) to other subsystems.
This class is thread-safe.
Implementation Note
This class must appear immutable to clients, even if it does all kinds of caching and pooling under the covers. It is crucial that the class is not only thread-safe, but also highly concurrent. Synchronization must be used extremely sparingly.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| public static class | |
| public static class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final transient CacheImplementor | |
| private final transient CurrentSessionContext | |
| private final transient SessionFactoryImpl. | |
| private final transient StatelessSessionBuilder | |
| private final transient EntityNameResolver | |
| private final transient EventEngine | |
| private final transient FastSessionServices | |
| private final transient Map | |
| private final transient Map | |
| private final transient Map | |
| private final transient JdbcServices | |
| private final PersistenceUnitUtil | |
| private static final CoreMessageLogger | |
| private final String | |
| private final transient SessionFactoryObserverChain | |
| private final transient QueryEngine | |
| private final transient RuntimeMetamodelsImplementor | |
| private final transient SchemaManager | |
| private final transient SessionFactoryServiceRegistry | |
| private final transient SessionFactoryOptions | |
| private final transient Map | |
| private final transient SqlStringGenerationContext | |
| private transient StatisticsImplementor | |
| private transient volatile SessionFactoryImpl. | |
| private final transient SessionFactoryImpl. | |
| private final transient JavaType | |
| private final String | |
| private final transient WrapperOptions |
| Access | Constructor and Description |
|---|---|
| public | SessionFactoryImpl(MetadataImplementor bootMetamodel, SessionFactoryOptions options)
Deprecated
for removal since 6.2. This constructor will be removed
|
| public | SessionFactoryImpl(final MetadataImplementor bootMetamodel, final SessionFactoryOptions options, final BootstrapContext bootstrapContext)
Deprecated
as a consequence of
MetadataImplementor being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public <T> void | addNamedEntityGraph(String
name for the entity graph graphName, EntityGraph<T> entity graph entityGraph)Implements jakarta. |
| public void | addNamedQuery(String
name for the query name, Query Query, TypedQuery, or StoredProcedureQuery object query)Implements jakarta. createNamedQuery or
createNamedStoredProcedureQuery method.
|
| public void | |
| public String | bestGuessEntityName(Object object)
Implements org. |
| private CurrentSessionContext | |
| private <K, V> Session | |
| private SessionFactoryImpl. | |
| private boolean | |
| public void | close()
Implements org. |
| public static Interceptor | configuredInterceptor(Interceptor interceptor, SessionFactoryOptions options)
|
| public static Interceptor | configuredInterceptor(Interceptor interceptor, boolean explicitNoInterceptor, SessionFactoryOptions options)
|
| public boolean | containsFetchProfileDefinition(String
The name to check name)Overrides default org. |
| private SessionFactoryImpl. | |
| public Session | createEntityManager()
Implements jakarta. EntityManager.
|
| public Session | createEntityManager(Map<K, V>
properties for entity manager map)Implements jakarta. EntityManager with the
specified Map of properties.
|
| public Session | createEntityManager(SynchronizationType
how and when the entity manager should be
synchronized with the current JTA transaction synchronizationType)Implements jakarta. EntityManager with the
specified synchronization type.
|
| public Session | createEntityManager(SynchronizationType
how and when the entity manager should be
synchronized with the current JTA transaction synchronizationType, Map<K, V> properties for entity manager map)Implements jakarta. EntityManager with the
specified synchronization type and map of properties.
|
| private static Map | createGenerators(JdbcServices jdbcServices, SqlStringGenerationContext sqlStringGenerationContext, MetadataImplementor bootMetamodel, BootstrapContext bootstrapContext)
Deprecated
as a consequence of
MetadataImplementor being deprecated.
|
| private CurrentSessionContext | |
| private static SqlStringGenerationContext | createSqlStringGenerationContext(MetadataImplementor bootMetamodel, SessionFactoryOptions options, JdbcServices jdbcServices)
Deprecated
as a consequence of
MetadataImplementor being deprecated.
|
| private void | |
| pack-priv static SessionFactoryImpl | Returns: The deserialized factoryThe stream from which to "read" the factory ois)
Deprecated
as a consequence of
Custom deserialization hook used during SessionFactoryImpl being deprecated.
Session deserialization.
|
| private void | |
| private void | |
| public RootGraphImplementor | findEntityGraphByName(String
the name given to some name)jakarta.Implements org. EntityGraph with the given name, or null
if there is no graph with the given name.
|
| public <T> List | findEntityGraphsByType(Class<T> entityClass)
Implements org. EntityGraphs registered for the given entity type.
|
| public CacheImplementor | getCache()
Implements org. |
| public CollectionMetadata | getCollectionMetadata(String roleName)
Deprecated
as a consequence of
CollectionMetadata being deprecated.
|
| public NodeBuilder | getCriteriaBuilder()
Implements org. HibernateCriteriaBuilder which may be used to
construct
criteria
queries.
|
| public Session | getCurrentSession()
Implements org. Session
implicitly associated with some context or scope.
|
| public CurrentTenantIdentifierResolver | |
| public CustomEntityDirtinessStrategy | |
| public Set | getDefinedFetchProfileNames()
Implements org. defined fetch profiles.
|
| public Set | getDefinedFilterNames()
Implements org. defined filters.
|
| public SessionFactoryImplementor. | |
| public EntityNotFoundDelegate | |
| public EventEngine | getEventEngine()
Implements org. |
| public FastSessionServices | |
| public FetchProfile | getFetchProfile(String
The name of the profile to retrieve. name)Implements org. |
| public FilterDefinition | getFilterDefinition(String
The name of the filter for which to obtain the definition. filterName)Implements org. |
| public Generator | getGenerator(String rootEntityName)
Implements org.
Deprecated
Get the identifier generator for the hierarchy
|
| public IdentifierGenerator | getIdentifierGenerator(String rootEntityName)
Implements org.
Deprecated
Get the identifier generator for the hierarchy
|
| public IdentifierGeneratorFactory | |
| public String | getIdentifierPropertyName(String className)
Implements org. |
| public Type | |
| public Interceptor | |
| public JdbcServices | getJdbcServices()
Implements org. |
| public JpaMetamodelImplementor | getJpaMetamodel()
Implements org. |
| public Integer | getMaximumFetchDepth()
Implements org. org. references,
defines a limit to how deep we should join for fetches.
|
| public MetamodelImplementor | getMetamodel()
Implements org.
Deprecated
as a consequence of
Return an instance of MetamodelImplementor being deprecated.
Metamodel interface for access to the
metamodel of the persistence unit.
|
| public String | getName()
Implements org. |
| public PersistenceUnitUtil | getPersistenceUnitUtil()
Implements jakarta. |
| public Map | getProperties()
Implements jakarta. |
| public QueryEngine | |
| public Reference | getReference()
Implements javax. |
| public Type | getReferencedPropertyType(String className, String propertyName)
Implements org. |
| public RuntimeMetamodelsImplementor | |
| public SchemaManager | getSchemaManager()
Implements org. SchemaManager with the same default catalog and schema as
pooled connections belonging to this factory.
|
| private static SessionFactoryServiceRegistry | getServiceRegistry(SessionFactoryOptions options, SessionFactoryImplementor self)
Deprecated
as a consequence of
SessionFactoryImplementor being deprecated.
|
| public ServiceRegistryImplementor | getServiceRegistry()
Implements org. |
| private static String | |
| public SessionFactoryOptions | getSessionFactoryOptions()
Implements org. |
| private static Map | |
| public SqlStringGenerationContext | |
| public StatisticsImplementor | getStatistics()
Implements org. |
| public JavaType | getTenantIdentifierJavaType()
Implements org. |
| public TypeConfiguration | |
| public String | getUuid()
Implements org. |
| public WrapperOptions | |
| private void | initializeMappingModel(MappingMetamodelImpl mappingMetamodelImpl, BootstrapContext bootstrapContext, MetadataImplementor bootMetamodel, SessionFactoryOptions options)
Deprecated
as a consequence of
MappingMetamodelImpl and MetadataImplementor being deprecated.
|
| private void | integrate(MetadataImplementor bootMetamodel, BootstrapContext bootstrapContext, SessionFactoryImpl.
Deprecated
as a consequence of
MetadataImplementor being deprecated.
|
| public boolean | |
| public boolean | isOpen()
Implements jakarta. |
| private static SessionFactory | |
| private void | |
| private void | |
| private void | |
| public SessionImplementor | openSession()
Implements org. SessionFactory#openSession() to widen the return type:
this is useful for internal code depending on SessionFactoryImplementor
as it would otherwise need to frequently resort to casting to the internal contract.
|
| public StatelessSession | openStatelessSession()
Implements org. |
| public StatelessSession | openStatelessSession(Connection
Connection provided by the application. connection)Implements org. Connection.
|
| public SessionImpl | openTemporarySession()
Implements org. |
| private void | primeSecondLevelCacheRegions(MetadataImplementor mappingMetadata)
Deprecated
as a consequence of
MetadataImplementor being deprecated.
|
| private void | readObject(ObjectInputStream
The stream from which the object is being deserialized. in)Custom serialization hook used when the factory is directly deserialized. |
| private Object | Returns: The resolved factory to use.Custom serialization hook used when the factory is directly deserialized. |
| private RuntimeModelCreationContext | runtimeModelCreationContext(BootstrapContext bootstrapContext, MetadataImplementor bootMetamodel, MappingMetamodelImplementor mappingMetamodel, TypeConfiguration typeConfiguration, SessionFactoryOptions options)
Deprecated
as a consequence of
MetadataImplementor and RuntimeModelCreationContext being deprecated.
|
| pack-priv void | serialize(ObjectOutputStream
The stream to which to write the factory oos)Custom serialization hook used during |
| public <T> T | unwrap(Class<T>
the class of the object to be returned. This is
normally either the underlying EntityManagerFactory
implementation class or an interface that it implements. type)Implements jakarta. |
| protected void | |
| public SessionFactoryImpl. | withOptions()
Implements org. Sessions with certain customized options.
|
| public StatelessSessionBuilder | withStatelessOptions()
Implements org. StatelessSession builder.
|
| private void | writeObject(ObjectOutputStream
The stream into which the object is being serialized. out)Custom serialization hook used when the factory is directly serialized |