Class TypeConfiguration

  • All Implemented Interfaces:, SessionFactoryObserver

    public class TypeConfiguration
    extends java.lang.Object
    implements SessionFactoryObserver,
    Defines a set of available Type instances as isolated from other configurations. The isolation is defined by each instance of a TypeConfiguration.

    Note that each Type is inherently "scoped" to a TypeConfiguration. We only ever access a Type through a TypeConfiguration - specifically the TypeConfiguration in effect for the current persistence unit.

    Even though each Type instance is scoped to a TypeConfiguration, Types do not inherently have access to that TypeConfiguration (mainly because Type is an extension contract - meaning that Hibernate does not manage the full set of Types available in ever TypeConfiguration). However Types will often want access to the TypeConfiguration, which can be achieved by the Type simply implementing the TypeConfigurationAware interface.

    See Also:
    Serialized Form
    • Constructor Detail

      • TypeConfiguration

        public TypeConfiguration()
    • Method Detail

      • getUuid

        public java.lang.String getUuid()
      • getTypeResolver

        public TypeResolver getTypeResolver()
        (since 5.3) No replacement, access to and handling of Types will be much different in 6.0
        Temporarily needed to support deprecations Retrieve the Type resolver associated with this factory.
        The type resolver
      • getImportMap

        public java.util.Map<java.lang.String,​java.lang.String> getImportMap()
      • getMetadataBuildingContext

        public MetadataBuildingContext getMetadataBuildingContext()
        Obtain the MetadataBuildingContext currently scoping the TypeConfiguration.
      • getSessionFactory

        public SessionFactoryImplementor getSessionFactory()
        Obtain the SessionFactory currently scoping the TypeConfiguration.
        The SessionFactory
        java.lang.IllegalStateException - if the TypeConfiguration is currently not associated with a SessionFactory (in "runtime stage").
      • getServiceRegistry

        public ServiceRegistry getServiceRegistry()
        Obtain the ServiceRegistry scoped to the TypeConfiguration.
        The ServiceRegistry
      • sessionFactoryClosed

        public void sessionFactoryClosed​(SessionFactory factory)
        Description copied from interface: SessionFactoryObserver
        Callback to indicate that the given factory has been closed. Care should be taken in how (if at all) the passed factory reference is used since it is closed.
        Specified by:
        sessionFactoryClosed in interface SessionFactoryObserver
        factory - The factory closed.