The approach here is to define all configuration and mapping sources in one API
and to then build the org. in one-shot. The configuration
and mapping sources defined here are just held here until the SessionFactory is built. This
is an important distinction from the legacy behavior of this class, where we would try to
incrementally build the mappings from sources as they were added. The ramification of this
change in behavior is that users can add configuration and mapping sources here, but they can
no longer query the in-flight state of mappings (org.,
org., etc) here.
Note
Internally this class uses the new bootstrapping approach when asked to build the SessionFactory.
org.hibernate.SessionFactory
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| private HashMap | |
| private List | |
| private List | |
| private final BootstrapServiceRegistry | |
| private CurrentTenantIdentifierResolver | |
| private EntityNotFoundDelegate | |
| private EntityTuplizerFactory | |
| private ImplicitNamingStrategy | |
| private Interceptor | |
| private static final CoreMessageLogger | |
| private final MetadataSources | |
| private Map | |
| private Map | |
| private Map | |
| private Map | |
| private PhysicalNamingStrategy | |
| private Properties | |
| private SessionFactoryObserver | |
| private SharedCacheMode | |
| private Map | |
| private Map | |
| private StandardServiceRegistryBuilder | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Configuration | Returns: this (for method chaining)The class containing annotations annotatedClass)Read metadata from the annotations associated with this class. |
| public void | addAttributeConverter(Class<? extends AttributeConverter<X, Y>>
The AttributeConverter class. attributeConverterClass, boolean Should the AttributeConverter be auto applied to property types as specified
by its "entity attribute" parameterized type? autoApply)Adds the AttributeConverter Class to this Configuration. |
| public void | addAttributeConverter(Class<? extends AttributeConverter<X, Y>>
The AttributeConverter class. attributeConverterClass)Adds the AttributeConverter Class to this Configuration. |
| public void | addAttributeConverter(AttributeConverter<X, Y>
The AttributeConverter instance. attributeConverter)Adds the AttributeConverter instance to this Configuration. |
| public void | addAttributeConverter(AttributeConverter<X, Y>
The AttributeConverter instance. attributeConverter, boolean Should the AttributeConverter be auto applied to property types as specified
by its "entity attribute" parameterized type? autoApply)Adds the AttributeConverter instance to this Configuration. |
| public void | addAttributeConverter(AttributeConverterDefinition definition)
Deprecated
as a consequence of
AttributeConverterDefinition being deprecated.
|
| public void | |
| public Configuration | Returns: this (for method chaining purposes)The cacheable mapping file to be added. xmlFile)Add a cached mapping file. |
| public Configuration | Returns: this (for method chaining purposes)The name of the file to be added. This must be in a form
useable to simply construct a xmlFile)java. instance.Add a cacheable mapping file. |
| public Configuration | Returns: The dom "deserialized" from the cached file.The xml file, not the bin! xmlFile)INTENDED FOR TESTSUITE USE ONLY! |
| public Configuration | |
| public Configuration | Returns: this (for method chaining purposes)The directory dir)Read all mapping documents from a directory tree. |
| public Configuration | Returns: this (for method chaining purposes)The DOM document doc)
Deprecated
Use addURL, addResource, addFile, etc. instead
Read mappings from a DOM Document
|
| public Configuration | |
| public Configuration | |
| public Configuration | Returns: this (for method chaining purposes)The input stream containing a DOM. xmlInputStream)Read mappings from an |
| public Configuration | |
| public Configuration | Returns: this (for method chaining)java package name packageName)Read package-level metadata. |
| public Configuration | Returns: this for method chainingThe properties to add. properties)Add the given properties to ours. |
| public Configuration | addResource(String resourceName, ClassLoader classLoader)
Deprecated
This form (accepting a ClassLoader) is no longer supported. Instead, add the ClassLoader
to the ClassLoaderService on the ServiceRegistry associated with this Configuration
|
| public Configuration | Returns: this (for method chaining purposes)The resource name resourceName)Read mappings as a application resourceName (i.e. classpath lookup) trying different class loaders. |
| public void | |
| public Configuration | |
| public Configuration | |
| public Configuration | Returns: this (for method chaining purposes)the parsed mapping binding)Read mappings that were parsed using |
| public void | |
| public SessionFactory | Returns: The builtSessionFactoryThe registry of services to be used in creating this session factory. serviceRegistry)
Deprecated
as a consequence of
Create a SessionFactory being deprecated.
SessionFactory using the properties and mappings in this configuration.
|
| public SessionFactory | Returns: The buildSessionFactory
Deprecated
as a consequence of
Create a SessionFactory being deprecated.
SessionFactory using the properties and mappings in this configuration.
|
| public Configuration | Returns: this for method chainingUse the mappings and properties specified in an application resource named hibernate.cfg.xml. |
| public Configuration | |
| public Configuration | |
| public Configuration | |
| public Configuration | |
| private static BootstrapServiceRegistry | |
| public CurrentTenantIdentifierResolver | |
| public EntityNotFoundDelegate | Returns: The user-supplied delegateRetrieve the user-supplied delegate to handle non-existent entity scenarios. |
| public EntityTuplizerFactory | |
| public Interceptor | |
| public Collection | |
| public Map | |
| public Map | |
| public Map | |
| public Properties | |
| public String | Returns: The value currently associated with that property name; may be null.The name of the property propertyName)Get a property value by name |
| public SessionFactoryObserver | |
| public Map | |
| public Map | |
| public StandardServiceRegistryBuilder | |
| public XmlMappingBinderAccess | Returns: An object capable of parsing XML mapping files that can then be passed toaddXmlMapping(Binding).
|
| public Configuration | Returns: this for method chainingThe properties to merge properties)Adds the incoming properties to the internal properties structure, as long as the internal structure does not already contain an entry for the given key. |
| public Configuration | |
| public Configuration | registerTypeOverride(BasicType
The type to register. type)Allows registration of a type into the type registry. |
| public Configuration | |
| public Configuration | |
| protected void | |
| public void | |
| public void | setEntityNotFoundDelegate(EntityNotFoundDelegate
The delegate to use entityNotFoundDelegate)Specify a user-supplied delegate to be used to handle scenarios where an entity could not be located by specified id. This is mainly intended for EJB3 implementations to be able to control how proxy initialization errors should be handled... |
| public void | |
| public Configuration | |
| public void | |
| public Configuration | Returns: this for method chainingThe new set of properties properties)Specify a completely new set of properties |
| public Configuration | Returns: this for method chainingThe name of the property to set propertyName, String The new property value value)Set a property value by name |
| public void | |
| public void | setSharedCacheMode(SharedCacheMode
The SharedCacheMode to use sharedCacheMode)Sets the SharedCacheMode to use. |