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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SessionFactorybuildSessionFactory()Short-hand form of building aSessionFactorythrough the builder without any additional option overrides.java.util.Collection<Table>collectTableMappings()CollectiongetCollectionBinding(java.lang.String role)Retrieves the collection mapping metadata for the given collection role.java.util.Collection<Collection>getCollectionBindings()Retrieves the Collection metadata representation for all known collections.DatabasegetDatabase()Retrieve the database model.PersistentClassgetEntityBinding(java.lang.String entityName)Retrieves the PersistentClass entity mapping metadata representation for the given entity name.java.util.Collection<PersistentClass>getEntityBindings()Retrieves the PersistentClass entity metadata representation for all known entities.FetchProfilegetFetchProfile(java.lang.String name)java.util.Collection<FetchProfile>getFetchProfiles()FilterDefinitiongetFilterDefinition(java.lang.String name)Retrieves a filter definition by name.java.util.Map<java.lang.String,FilterDefinition>getFilterDefinitions()Retrieves the complete map of filter definitions.IdentifierGeneratorDefinitiongetIdentifierGenerator(java.lang.String name)java.util.Map<java.lang.String,java.lang.String>getImports()Retrieves all defined imports (class renames).NamedEntityGraphDefinitiongetNamedEntityGraph(java.lang.String name)java.util.Map<java.lang.String,NamedEntityGraphDefinition>getNamedEntityGraphs()NamedSQLQueryDefinitiongetNamedNativeQueryDefinition(java.lang.String name)Retrieve named SQL query metadata.java.util.Collection<NamedSQLQueryDefinition>getNamedNativeQueryDefinitions()java.util.Collection<NamedProcedureCallDefinition>getNamedProcedureCallDefinitions()NamedQueryDefinitiongetNamedQueryDefinition(java.lang.String name)Retrieve named query metadata by name.java.util.Collection<NamedQueryDefinition>getNamedQueryDefinitions()ResultSetMappingDefinitiongetResultSetMapping(java.lang.String name)Retrieve the metadata for a named SQL result set mapping.java.util.Map<java.lang.String,ResultSetMappingDefinition>getResultSetMappingDefinitions()SessionFactoryBuildergetSessionFactoryBuilder()Get the builder forSessionFactoryinstances based on this metamodel.java.util.Map<java.lang.String,SQLFunction>getSqlFunctionMap()TypeDefinitiongetTypeDefinition(java.lang.String typeName)Retrieve a type definition by name.java.util.UUIDgetUUID()Gets theUUIDfor this metamodel.-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierGeneratorFactory, getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
-
-
-
-
Method Detail
-
getSessionFactoryBuilder
SessionFactoryBuilder getSessionFactoryBuilder()
Get the builder forSessionFactoryinstances based on this metamodel.- Returns:
- The builder for
SessionFactoryinstances.
-
buildSessionFactory
SessionFactory buildSessionFactory()
Short-hand form of building aSessionFactorythrough the builder without any additional option overrides.- Returns:
- THe built SessionFactory.
-
getUUID
java.util.UUID getUUID()
Gets theUUIDfor this metamodel.- Returns:
- the UUID.
-
getDatabase
Database getDatabase()
Retrieve the database model.- Returns:
- The database model.
-
getEntityBindings
java.util.Collection<PersistentClass> getEntityBindings()
Retrieves the PersistentClass entity metadata representation for all known entities. Returned collection is immutable- Returns:
- All PersistentClass representations.
-
getEntityBinding
PersistentClass getEntityBinding(java.lang.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
nullif no matching entity found.
-
getCollectionBindings
java.util.Collection<Collection> getCollectionBindings()
Retrieves the Collection metadata representation for all known collections. Returned collection is immutable- Returns:
- All Collection representations.
-
getCollectionBinding
Collection getCollectionBinding(java.lang.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
nullif no matching collection found.
-
getImports
java.util.Map<java.lang.String,java.lang.String> getImports()
Retrieves all defined imports (class renames).- Returns:
- All imports
-
getNamedQueryDefinition
NamedQueryDefinition getNamedQueryDefinition(java.lang.String name)
Retrieve named query metadata by name.- Parameters:
name- The query name- Returns:
- The named query metadata, or
null.
-
getNamedQueryDefinitions
java.util.Collection<NamedQueryDefinition> getNamedQueryDefinitions()
-
getNamedNativeQueryDefinition
NamedSQLQueryDefinition getNamedNativeQueryDefinition(java.lang.String name)
Retrieve named SQL query metadata.- Parameters:
name- The SQL query name.- Returns:
- The named query metadata, or
null
-
getNamedNativeQueryDefinitions
java.util.Collection<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
-
getNamedProcedureCallDefinitions
java.util.Collection<NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
-
getResultSetMapping
ResultSetMappingDefinition getResultSetMapping(java.lang.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
nullif none found.
-
getResultSetMappingDefinitions
java.util.Map<java.lang.String,ResultSetMappingDefinition> getResultSetMappingDefinitions()
-
getTypeDefinition
TypeDefinition getTypeDefinition(java.lang.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
java.util.Map<java.lang.String,FilterDefinition> getFilterDefinitions()
Retrieves the complete map of filter definitions. Returned map is immutable- Returns:
- The filter definition map.
-
getFilterDefinition
FilterDefinition getFilterDefinition(java.lang.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(java.lang.String name)
-
getFetchProfiles
java.util.Collection<FetchProfile> getFetchProfiles()
-
getNamedEntityGraph
NamedEntityGraphDefinition getNamedEntityGraph(java.lang.String name)
-
getNamedEntityGraphs
java.util.Map<java.lang.String,NamedEntityGraphDefinition> getNamedEntityGraphs()
-
getIdentifierGenerator
IdentifierGeneratorDefinition getIdentifierGenerator(java.lang.String name)
-
collectTableMappings
java.util.Collection<Table> collectTableMappings()
-
getSqlFunctionMap
java.util.Map<java.lang.String,SQLFunction> getSqlFunctionMap()
-
-