Package org.hibernate.boot
Interface Metadata
-
- All Superinterfaces:
Mapping
- All Known Subinterfaces:
InFlightMetadataCollector
,MetadataImplementor
- All Known Implementing Classes:
AbstractDelegatingMetadata
,InFlightMetadataCollectorImpl
,MetadataImpl
public interface Metadata extends Mapping
Represents the ORM model as determined by aggregating the provided mapping sources. An instance may be obtained by callingMetadataSources.buildMetadata()
.- Since:
- 5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SessionFactory
buildSessionFactory()
Short-hand form of building aSessionFactory
through the builder without any additional option overrides.Collection<Table>
collectTableMappings()
Collection
getCollectionBinding(String role)
Retrieves the collection mapping metadata for the given collection role.Collection<Collection>
getCollectionBindings()
Retrieves the Collection metadata representation for all known collections.Set<String>
getContributors()
All of the known model contributorsDatabase
getDatabase()
Retrieve the database model.PersistentClass
getEntityBinding(String entityName)
Retrieves the PersistentClass entity mapping metadata representation for the given entity name.Collection<PersistentClass>
getEntityBindings()
Retrieves the PersistentClass entity metadata representation for all known entities.FetchProfile
getFetchProfile(String name)
Collection<FetchProfile>
getFetchProfiles()
FilterDefinition
getFilterDefinition(String name)
Retrieves a filter definition by name.Map<String,FilterDefinition>
getFilterDefinitions()
Retrieves the complete map of filter definitions.IdentifierGeneratorDefinition
getIdentifierGenerator(String name)
Map<String,String>
getImports()
Retrieves all defined imports (class renames).NamedEntityGraphDefinition
getNamedEntityGraph(String name)
Map<String,NamedEntityGraphDefinition>
getNamedEntityGraphs()
NamedHqlQueryDefinition
getNamedHqlQueryMapping(String name)
Retrieve named query metadata by name.NamedNativeQueryDefinition
getNamedNativeQueryMapping(String name)
Retrieve named SQL query metadata.NamedProcedureCallDefinition
getNamedProcedureCallMapping(String name)
Retrieve named procedure metadata.NamedResultSetMappingDescriptor
getResultSetMapping(String name)
Retrieve the metadata for a named SQL result set mapping.SessionFactoryBuilder
getSessionFactoryBuilder()
Get the builder forSessionFactory
instances based on this metamodel.Map<String,SqmFunctionDescriptor>
getSqlFunctionMap()
TypeDefinition
getTypeDefinition(String typeName)
Retrieve a type definition by name.UUID
getUUID()
Gets theUUID
for this metamodel.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 definitions-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
-
-
-
-
Method Detail
-
getSessionFactoryBuilder
SessionFactoryBuilder getSessionFactoryBuilder()
Get the builder forSessionFactory
instances based on this metamodel.- Returns:
- The builder for
SessionFactory
instances.
-
buildSessionFactory
SessionFactory buildSessionFactory()
Short-hand form of building aSessionFactory
through the builder without any additional option overrides.- Returns:
- THe built SessionFactory.
-
getDatabase
Database getDatabase()
Retrieve the database model.- Returns:
- The database model.
-
getEntityBindings
Collection<PersistentClass> getEntityBindings()
Retrieves the PersistentClass entity metadata representation for all known entities. Returned collection is immutable- Returns:
- All PersistentClass representations.
-
getEntityBinding
PersistentClass getEntityBinding(String entityName)
Retrieves the PersistentClass entity mapping metadata representation for the given entity name.- Parameters:
entityName
- The entity name for which to retrieve the metadata.- Returns:
- The entity mapping metadata, or
null
if no matching entity found.
-
getCollectionBindings
Collection<Collection> getCollectionBindings()
Retrieves the Collection metadata representation for all known collections. Returned collection is immutable- Returns:
- All Collection representations.
-
getCollectionBinding
Collection getCollectionBinding(String role)
Retrieves the collection mapping metadata for the given collection role.- Parameters:
role
- The collection role for which to retrieve the metadata.- Returns:
- The collection mapping metadata, or
null
if no matching collection found.
-
getImports
Map<String,String> getImports()
Retrieves all defined imports (class renames).- Returns:
- All imports
-
getNamedHqlQueryMapping
NamedHqlQueryDefinition getNamedHqlQueryMapping(String name)
Retrieve named query metadata by name.- Returns:
- The named query metadata, or
null
.
-
visitNamedHqlQueryDefinitions
void visitNamedHqlQueryDefinitions(Consumer<NamedHqlQueryDefinition> definitionConsumer)
Visit all named HQL query definitions
-
getNamedNativeQueryMapping
NamedNativeQueryDefinition getNamedNativeQueryMapping(String name)
Retrieve named SQL query metadata.- Returns:
- The named query metadata, or
null
-
visitNamedNativeQueryDefinitions
void visitNamedNativeQueryDefinitions(Consumer<NamedNativeQueryDefinition> definitionConsumer)
Visit all named native query definitions
-
getNamedProcedureCallMapping
NamedProcedureCallDefinition getNamedProcedureCallMapping(String name)
Retrieve named procedure metadata.- Returns:
- The named procedure metadata, or
null
-
visitNamedProcedureCallDefinition
void visitNamedProcedureCallDefinition(Consumer<NamedProcedureCallDefinition> definitionConsumer)
Visit all named callable query definitions
-
getResultSetMapping
NamedResultSetMappingDescriptor getResultSetMapping(String name)
Retrieve the metadata for a named SQL result set mapping.- Parameters:
name
- The mapping name.- Returns:
- The named result set mapping metadata, or
null
if none found.
-
visitNamedResultSetMappingDefinition
void visitNamedResultSetMappingDefinition(Consumer<NamedResultSetMappingDescriptor> definitionConsumer)
Visit all named SQL result set mapping definitions
-
getTypeDefinition
TypeDefinition getTypeDefinition(String typeName)
Retrieve a type definition by name.- Returns:
- The named type definition, or
null
-
getFilterDefinitions
Map<String,FilterDefinition> getFilterDefinitions()
Retrieves the complete map of filter definitions. Returned map is immutable- Returns:
- The filter definition map.
-
getFilterDefinition
FilterDefinition getFilterDefinition(String name)
Retrieves a filter definition by name.- Parameters:
name
- The name of the filter definition to retrieve .- Returns:
- The filter definition, or
null
.
-
getFetchProfile
FetchProfile getFetchProfile(String name)
-
getFetchProfiles
Collection<FetchProfile> getFetchProfiles()
-
getNamedEntityGraph
NamedEntityGraphDefinition getNamedEntityGraph(String name)
-
getNamedEntityGraphs
Map<String,NamedEntityGraphDefinition> getNamedEntityGraphs()
-
getIdentifierGenerator
IdentifierGeneratorDefinition getIdentifierGenerator(String name)
-
collectTableMappings
Collection<Table> collectTableMappings()
-
getSqlFunctionMap
Map<String,SqmFunctionDescriptor> getSqlFunctionMap()
-
-