Package org.hibernate.boot.internal
Class MetadataImpl
java.lang.Object
org.hibernate.boot.internal.MetadataImpl
- All Implemented Interfaces:
Serializable
,Metadata
,MetadataImplementor
,Mapping
Container for configuration data collected during binding the metamodel.
- See Also:
-
Constructor Summary
ConstructorDescriptionMetadataImpl
(UUID uuid, MetadataBuildingOptions metadataBuildingOptions, Map<String, PersistentClass> entityBindingMap, List<Component> composites, Map<Class<?>, Component> genericComponentsMap, Map<Class<?>, DiscriminatorType<?>> embeddableDiscriminatorTypesMap, Map<Class<?>, MappedSuperclass> mappedSuperclassMap, Map<String, Collection> collectionBindingMap, Map<String, TypeDefinition> typeDefinitionMap, Map<String, FilterDefinition> filterDefinitionMap, Map<String, FetchProfile> fetchProfileMap, Map<String, String> imports, Map<String, IdentifierGeneratorDefinition> idGeneratorDefinitionMap, Map<String, NamedHqlQueryDefinition> namedQueryMap, Map<String, NamedNativeQueryDefinition> namedNativeQueryMap, Map<String, NamedProcedureCallDefinition> namedProcedureCallMap, Map<String, NamedResultSetMappingDescriptor> sqlResultSetMappingMap, Map<String, NamedEntityGraphDefinition> namedEntityGraphMap, Map<String, SqmFunctionDescriptor> sqlFunctionMap, Database database, BootstrapContext bootstrapContext) -
Method Summary
Modifier and TypeMethodDescriptionbuildNamedQueryRepository
(SessionFactoryImplementor sessionFactory) Short-hand form of building aSessionFactory
through the builder without any additional option overrides.getCollectionBinding
(String role) Retrieves the collection mapping metadata for the given collection role.Retrieves the Collection metadata representation for all known collections.All of the known model contributorsRetrieve the database model.Map<Class<?>,
DiscriminatorType<?>> getEntityBinding
(String entityName) Retrieves the PersistentClass entity mapping metadata representation for the given entity name.Retrieves the PersistentClass entity metadata representation for all known entities.getFetchProfile
(String name) getFilterDefinition
(String name) Retrieves a filter definition by name.Retrieves the complete map of filter definitions.Access to theSqmFunctionRegistry
belonging to theBootstrapContext
getGenericComponent
(Class<?> componentClass) getIdentifierGenerator
(String name) getIdentifierPropertyName
(String entityName) getIdentifierType
(String entityName) Retrieves all defined imports (class renames).Map<Class<?>,
MappedSuperclass> Access to the options used to build thisMetadata
getNamedEntityGraph
(String name) Retrieve named query metadata by name.Retrieve named SQL query metadata.Retrieve named procedure metadata.getReferencedPropertyType
(String entityName, String propertyName) getResultSetMapping
(String name) Retrieve the metadata for a named SQL result set mapping.Get the builder forSessionFactory
instances based on this metamodel.Access to theTypeConfiguration
belonging to theBootstrapContext
getTypeDefinition
(String typeName) Retrieve a type definition by name.getUUID()
Gets theUUID
for this metamodel.void
initSessionFactory
(SessionFactoryImplementor sessionFactory) void
orderColumns
(boolean forceOrdering) resolveEmbeddableDiscriminatorType
(Class<?> embeddableClass, Supplier<DiscriminatorType<?>> supplier) void
validate()
void
visitNamedHqlQueryDefinitions
(Consumer<NamedHqlQueryDefinition> definitionConsumer) Visit all named HQL query definitionsvoid
visitNamedNativeQueryDefinitions
(Consumer<NamedNativeQueryDefinition> definitionConsumer) Visit all named native query definitionsvoid
visitNamedProcedureCallDefinition
(Consumer<NamedProcedureCallDefinition> definitionConsumer) Visit all named callable query definitionsvoid
visitNamedResultSetMappingDefinition
(Consumer<NamedResultSetMappingDescriptor> definitionConsumer) Visit all named SQL result set mapping definitionsvoid
visitRegisteredComponents
(Consumer<Component> consumer)
-
Constructor Details
-
MetadataImpl
public MetadataImpl(UUID uuid, MetadataBuildingOptions metadataBuildingOptions, Map<String, PersistentClass> entityBindingMap, List<Component> composites, Map<Class<?>, Component> genericComponentsMap, Map<Class<?>, DiscriminatorType<?>> embeddableDiscriminatorTypesMap, Map<Class<?>, MappedSuperclass> mappedSuperclassMap, Map<String, Collection> collectionBindingMap, Map<String, TypeDefinition> typeDefinitionMap, Map<String, FilterDefinition> filterDefinitionMap, Map<String, FetchProfile> fetchProfileMap, Map<String, String> imports, Map<String, IdentifierGeneratorDefinition> idGeneratorDefinitionMap, Map<String, NamedHqlQueryDefinition> namedQueryMap, Map<String, NamedNativeQueryDefinition> namedNativeQueryMap, Map<String, NamedProcedureCallDefinition> namedProcedureCallMap, Map<String, NamedResultSetMappingDescriptor> sqlResultSetMappingMap, Map<String, NamedEntityGraphDefinition> namedEntityGraphMap, Map<String, SqmFunctionDescriptor> sqlFunctionMap, Database database, BootstrapContext bootstrapContext)
-
-
Method Details
-
getMetadataBuildingOptions
Description copied from interface:MetadataImplementor
Access to the options used to build thisMetadata
- Specified by:
getMetadataBuildingOptions
in interfaceMetadataImplementor
- Returns:
- The
MetadataBuildingOptions
-
getTypeConfiguration
Description copied from interface:MetadataImplementor
Access to theTypeConfiguration
belonging to theBootstrapContext
- Specified by:
getTypeConfiguration
in interfaceMetadataImplementor
-
getFunctionRegistry
Description copied from interface:MetadataImplementor
Access to theSqmFunctionRegistry
belonging to theBootstrapContext
- Specified by:
getFunctionRegistry
in interfaceMetadataImplementor
-
getSessionFactoryBuilder
Description copied from interface:Metadata
Get the builder forSessionFactory
instances based on this metamodel.- Specified by:
getSessionFactoryBuilder
in interfaceMetadata
- Returns:
- The builder for
SessionFactory
instances.
-
buildSessionFactory
Description copied from interface:Metadata
Short-hand form of building aSessionFactory
through the builder without any additional option overrides.- Specified by:
buildSessionFactory
in interfaceMetadata
- Returns:
- THe built SessionFactory.
-
getUUID
Description copied from interface:Metadata
Gets theUUID
for this metamodel. -
getDatabase
Description copied from interface:Metadata
Retrieve the database model.- Specified by:
getDatabase
in interfaceMetadata
- Returns:
- The database model.
-
getEntityBindings
Description copied from interface:Metadata
Retrieves the PersistentClass entity metadata representation for all known entities. Returned collection is immutable- Specified by:
getEntityBindings
in interfaceMetadata
- Returns:
- All PersistentClass representations.
-
getEntityBinding
Description copied from interface:Metadata
Retrieves the PersistentClass entity mapping metadata representation for the given entity name.- Specified by:
getEntityBinding
in interfaceMetadata
- Parameters:
entityName
- The entity name for which to retrieve the metadata.- Returns:
- The entity mapping metadata, or
null
if no matching entity found.
-
getCollectionBindings
Description copied from interface:Metadata
Retrieves the Collection metadata representation for all known collections. Returned collection is immutable- Specified by:
getCollectionBindings
in interfaceMetadata
- Returns:
- All Collection representations.
-
getCollectionBinding
Description copied from interface:Metadata
Retrieves the collection mapping metadata for the given collection role.- Specified by:
getCollectionBinding
in interfaceMetadata
- Parameters:
role
- The collection role for which to retrieve the metadata.- Returns:
- The collection mapping metadata, or
null
if no matching collection found.
-
getImports
Description copied from interface:Metadata
Retrieves all defined imports (class renames).- Specified by:
getImports
in interfaceMetadata
- Returns:
- All imports
-
getNamedHqlQueryMapping
Description copied from interface:Metadata
Retrieve named query metadata by name.- Specified by:
getNamedHqlQueryMapping
in interfaceMetadata
- Returns:
- The named query metadata, or
null
.
-
visitNamedHqlQueryDefinitions
Description copied from interface:Metadata
Visit all named HQL query definitions- Specified by:
visitNamedHqlQueryDefinitions
in interfaceMetadata
-
getNamedNativeQueryMapping
Description copied from interface:Metadata
Retrieve named SQL query metadata.- Specified by:
getNamedNativeQueryMapping
in interfaceMetadata
- Returns:
- The named query metadata, or
null
-
visitNamedNativeQueryDefinitions
public void visitNamedNativeQueryDefinitions(Consumer<NamedNativeQueryDefinition> definitionConsumer) Description copied from interface:Metadata
Visit all named native query definitions- Specified by:
visitNamedNativeQueryDefinitions
in interfaceMetadata
-
getNamedProcedureCallMapping
Description copied from interface:Metadata
Retrieve named procedure metadata.- Specified by:
getNamedProcedureCallMapping
in interfaceMetadata
- Returns:
- The named procedure metadata, or
null
-
visitNamedProcedureCallDefinition
public void visitNamedProcedureCallDefinition(Consumer<NamedProcedureCallDefinition> definitionConsumer) Description copied from interface:Metadata
Visit all named callable query definitions- Specified by:
visitNamedProcedureCallDefinition
in interfaceMetadata
-
getResultSetMapping
Description copied from interface:Metadata
Retrieve the metadata for a named SQL result set mapping.- Specified by:
getResultSetMapping
in interfaceMetadata
- Parameters:
name
- The mapping name.- Returns:
- The named result set mapping metadata, or
null
if none found.
-
visitNamedResultSetMappingDefinition
public void visitNamedResultSetMappingDefinition(Consumer<NamedResultSetMappingDescriptor> definitionConsumer) Description copied from interface:Metadata
Visit all named SQL result set mapping definitions- Specified by:
visitNamedResultSetMappingDefinition
in interfaceMetadata
-
getTypeDefinition
Description copied from interface:Metadata
Retrieve a type definition by name.- Specified by:
getTypeDefinition
in interfaceMetadata
- Returns:
- The named type definition, or
null
-
getFilterDefinitions
Description copied from interface:Metadata
Retrieves the complete map of filter definitions. Returned map is immutable- Specified by:
getFilterDefinitions
in interfaceMetadata
- Returns:
- The filter definition map.
-
getFilterDefinition
Description copied from interface:Metadata
Retrieves a filter definition by name.- Specified by:
getFilterDefinition
in interfaceMetadata
- Parameters:
name
- The name of the filter definition to retrieve .- Returns:
- The filter definition, or
null
.
-
getFetchProfile
- Specified by:
getFetchProfile
in interfaceMetadata
-
getFetchProfiles
- Specified by:
getFetchProfiles
in interfaceMetadata
-
getNamedEntityGraph
- Specified by:
getNamedEntityGraph
in interfaceMetadata
-
getNamedEntityGraphs
- Specified by:
getNamedEntityGraphs
in interfaceMetadata
-
getIdentifierGenerator
- Specified by:
getIdentifierGenerator
in interfaceMetadata
-
getSqlFunctionMap
- Specified by:
getSqlFunctionMap
in interfaceMetadata
-
getContributors
Description copied from interface:Metadata
All of the known model contributors- Specified by:
getContributors
in interfaceMetadata
-
collectTableMappings
- Specified by:
collectTableMappings
in interfaceMetadata
-
buildNamedQueryRepository
- Specified by:
buildNamedQueryRepository
in interfaceMetadataImplementor
-
orderColumns
public void orderColumns(boolean forceOrdering) - Specified by:
orderColumns
in interfaceMetadataImplementor
-
validate
- Specified by:
validate
in interfaceMetadataImplementor
- Throws:
MappingException
-
getMappedSuperclassMappingsCopy
- Specified by:
getMappedSuperclassMappingsCopy
in interfaceMetadataImplementor
-
initSessionFactory
- Specified by:
initSessionFactory
in interfaceMetadataImplementor
-
visitRegisteredComponents
- Specified by:
visitRegisteredComponents
in interfaceMetadataImplementor
-
getGenericComponent
- Specified by:
getGenericComponent
in interfaceMetadataImplementor
-
resolveEmbeddableDiscriminatorType
public DiscriminatorType<?> resolveEmbeddableDiscriminatorType(Class<?> embeddableClass, Supplier<DiscriminatorType<?>> supplier) - Specified by:
resolveEmbeddableDiscriminatorType
in interfaceMetadataImplementor
-
getIdentifierType
- Specified by:
getIdentifierType
in interfaceMapping
- Throws:
MappingException
-
getIdentifierPropertyName
- Specified by:
getIdentifierPropertyName
in interfaceMapping
- Throws:
MappingException
-
getReferencedPropertyType
public Type getReferencedPropertyType(String entityName, String propertyName) throws MappingException - Specified by:
getReferencedPropertyType
in interfaceMapping
- Throws:
MappingException
-
getEntityBindingMap
-
getCollectionBindingMap
-
getTypeDefinitionMap
-
getFetchProfileMap
-
getMappedSuperclassMap
-
getIdGeneratorDefinitionMap
-
getNamedEntityGraphMap
-
getBootstrapContext
-
getNamedQueryMap
-
getNamedNativeQueryMap
-
getNamedProcedureCallMap
-
getSqlResultSetMappingMap
-
getComposites
-
getGenericComponentsMap
-
getEmbeddableDiscriminatorTypesMap
-