Package org.hibernate.boot
Interface Metadata
-
- All Superinterfaces:
Mapping
- All Known Subinterfaces:
InFlightMetadataCollector
,MetadataImplementor
- All Known Implementing Classes:
AbstractDelegatingMetadata
public interface Metadata extends Mapping
Represents the ORM model as determined from all provided mapping sources. NOTE : for the time being this is essentially a copy of the legacy Mappings contract, split between reading the mapping information exposed here and collecting it via InFlightMetadataCollector- Since:
- 5.0
-
-
Method Summary
-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierGeneratorFactory, 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
-
getNamedQueryDefinition
NamedQueryDefinition getNamedQueryDefinition(String name)
Retrieve named query metadata by name.- Parameters:
name
- The query name- Returns:
- The named query metadata, or
null
.
-
getNamedQueryDefinitions
Collection<NamedQueryDefinition> getNamedQueryDefinitions()
-
getNamedNativeQueryDefinition
NamedSQLQueryDefinition getNamedNativeQueryDefinition(String name)
Retrieve named SQL query metadata.- Parameters:
name
- The SQL query name.- Returns:
- The named query metadata, or
null
-
getNamedNativeQueryDefinitions
Collection<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
-
getNamedProcedureCallDefinitions
Collection<NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
-
getResultSetMapping
ResultSetMappingDefinition 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.
-
getResultSetMappingDefinitions
Map<String,ResultSetMappingDefinition> getResultSetMappingDefinitions()
-
getTypeDefinition
TypeDefinition getTypeDefinition(String typeName)
Retrieve a type definition by name.- Parameters:
typeName
- The name of the type definition to retrieve.- 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,SQLFunction> getSqlFunctionMap()
-
-