Package org.hibernate.boot.spi
Class AbstractDelegatingMetadata
- java.lang.Object
-
- org.hibernate.boot.spi.AbstractDelegatingMetadata
-
- All Implemented Interfaces:
Metadata
,MetadataImplementor
,Mapping
public abstract class AbstractDelegatingMetadata extends java.lang.Object implements MetadataImplementor
Convenience base class for custom implementors ofMetadataImplementor
using delegation.
-
-
Constructor Summary
Constructors Constructor Description AbstractDelegatingMetadata(MetadataImplementor delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NamedQueryRepository
buildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)
SessionFactory
buildSessionFactory()
Short-hand form of building aSessionFactory
through the builder without any additional option overrides.java.util.Collection<Table>
collectTableMappings()
protected MetadataImplementor
delegate()
Collection
getCollectionBinding(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.Database
getDatabase()
Retrieve the database model.PersistentClass
getEntityBinding(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.FetchProfile
getFetchProfile(java.lang.String name)
java.util.Collection<FetchProfile>
getFetchProfiles()
FilterDefinition
getFilterDefinition(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.IdentifierGeneratorDefinition
getIdentifierGenerator(java.lang.String name)
IdentifierGeneratorFactory
getIdentifierGeneratorFactory()
Allow access to the id generator factory, though this is only needed/allowed from configuration.java.lang.String
getIdentifierPropertyName(java.lang.String className)
Type
getIdentifierType(java.lang.String className)
java.util.Map<java.lang.String,java.lang.String>
getImports()
Retrieves all defined imports (class renames).java.util.Set<MappedSuperclass>
getMappedSuperclassMappingsCopy()
MetadataBuildingOptions
getMetadataBuildingOptions()
Access to the options used to build this MetadataNamedEntityGraphDefinition
getNamedEntityGraph(java.lang.String name)
java.util.Map<java.lang.String,NamedEntityGraphDefinition>
getNamedEntityGraphs()
NamedSQLQueryDefinition
getNamedNativeQueryDefinition(java.lang.String name)
Retrieve named SQL query metadata.java.util.Collection<NamedSQLQueryDefinition>
getNamedNativeQueryDefinitions()
java.util.Collection<NamedProcedureCallDefinition>
getNamedProcedureCallDefinitions()
NamedQueryDefinition
getNamedQueryDefinition(java.lang.String name)
Retrieve named query metadata by name.java.util.Collection<NamedQueryDefinition>
getNamedQueryDefinitions()
Type
getReferencedPropertyType(java.lang.String className, java.lang.String propertyName)
ResultSetMappingDefinition
getResultSetMapping(java.lang.String name)
Retrieve the metadata for a named SQL result set mapping.java.util.Map<java.lang.String,ResultSetMappingDefinition>
getResultSetMappingDefinitions()
SessionFactoryBuilder
getSessionFactoryBuilder()
Get the builder forSessionFactory
instances based on this metamodel.java.util.Map<java.lang.String,SQLFunction>
getSqlFunctionMap()
TypeConfiguration
getTypeConfiguration()
Access to the TypeConfigurationTypeDefinition
getTypeDefinition(java.lang.String typeName)
Retrieve a type definition by name.TypeResolver
getTypeResolver()
Deprecated.(since 5.3) No replacement, access to and handling of Types will be much different in 6.0java.util.UUID
getUUID()
Gets theUUID
for this metamodel.void
initSessionFactory(SessionFactoryImplementor sessionFactory)
void
validate()
-
-
-
Constructor Detail
-
AbstractDelegatingMetadata
public AbstractDelegatingMetadata(MetadataImplementor delegate)
-
-
Method Detail
-
delegate
protected MetadataImplementor delegate()
-
getIdentifierGeneratorFactory
public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Description copied from interface:Mapping
Allow access to the id generator factory, though this is only needed/allowed from configuration.- Specified by:
getIdentifierGeneratorFactory
in interfaceMapping
- Returns:
- Access to the identifier generator factory
-
getIdentifierType
public Type getIdentifierType(java.lang.String className) throws MappingException
- Specified by:
getIdentifierType
in interfaceMapping
- Throws:
MappingException
-
getIdentifierPropertyName
public java.lang.String getIdentifierPropertyName(java.lang.String className) throws MappingException
- Specified by:
getIdentifierPropertyName
in interfaceMapping
- Throws:
MappingException
-
getReferencedPropertyType
public Type getReferencedPropertyType(java.lang.String className, java.lang.String propertyName) throws MappingException
- Specified by:
getReferencedPropertyType
in interfaceMapping
- Throws:
MappingException
-
getSessionFactoryBuilder
public SessionFactoryBuilder 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
public SessionFactory 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
public java.util.UUID getUUID()
Description copied from interface:Metadata
Gets theUUID
for this metamodel.
-
getDatabase
public Database getDatabase()
Description copied from interface:Metadata
Retrieve the database model.- Specified by:
getDatabase
in interfaceMetadata
- Returns:
- The database model.
-
getEntityBindings
public java.util.Collection<PersistentClass> 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
public PersistentClass getEntityBinding(java.lang.String entityName)
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
public java.util.Collection<Collection> 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
public Collection getCollectionBinding(java.lang.String role)
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
public java.util.Map<java.lang.String,java.lang.String> getImports()
Description copied from interface:Metadata
Retrieves all defined imports (class renames).- Specified by:
getImports
in interfaceMetadata
- Returns:
- All imports
-
getNamedQueryDefinition
public NamedQueryDefinition getNamedQueryDefinition(java.lang.String name)
Description copied from interface:Metadata
Retrieve named query metadata by name.- Specified by:
getNamedQueryDefinition
in interfaceMetadata
- Parameters:
name
- The query name- Returns:
- The named query metadata, or
null
.
-
getNamedQueryDefinitions
public java.util.Collection<NamedQueryDefinition> getNamedQueryDefinitions()
- Specified by:
getNamedQueryDefinitions
in interfaceMetadata
-
getNamedNativeQueryDefinition
public NamedSQLQueryDefinition getNamedNativeQueryDefinition(java.lang.String name)
Description copied from interface:Metadata
Retrieve named SQL query metadata.- Specified by:
getNamedNativeQueryDefinition
in interfaceMetadata
- Parameters:
name
- The SQL query name.- Returns:
- The named query metadata, or
null
-
getNamedNativeQueryDefinitions
public java.util.Collection<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
- Specified by:
getNamedNativeQueryDefinitions
in interfaceMetadata
-
getNamedProcedureCallDefinitions
public java.util.Collection<NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
- Specified by:
getNamedProcedureCallDefinitions
in interfaceMetadata
-
getResultSetMapping
public ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
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.
-
getResultSetMappingDefinitions
public java.util.Map<java.lang.String,ResultSetMappingDefinition> getResultSetMappingDefinitions()
- Specified by:
getResultSetMappingDefinitions
in interfaceMetadata
-
getTypeDefinition
public TypeDefinition getTypeDefinition(java.lang.String typeName)
Description copied from interface:Metadata
Retrieve a type definition by name.- Specified by:
getTypeDefinition
in interfaceMetadata
- Parameters:
typeName
- The name of the type definition to retrieve.- Returns:
- The named type definition, or
null
-
getFilterDefinitions
public java.util.Map<java.lang.String,FilterDefinition> 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
public FilterDefinition getFilterDefinition(java.lang.String name)
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
public FetchProfile getFetchProfile(java.lang.String name)
- Specified by:
getFetchProfile
in interfaceMetadata
-
getFetchProfiles
public java.util.Collection<FetchProfile> getFetchProfiles()
- Specified by:
getFetchProfiles
in interfaceMetadata
-
getNamedEntityGraph
public NamedEntityGraphDefinition getNamedEntityGraph(java.lang.String name)
- Specified by:
getNamedEntityGraph
in interfaceMetadata
-
getNamedEntityGraphs
public java.util.Map<java.lang.String,NamedEntityGraphDefinition> getNamedEntityGraphs()
- Specified by:
getNamedEntityGraphs
in interfaceMetadata
-
getIdentifierGenerator
public IdentifierGeneratorDefinition getIdentifierGenerator(java.lang.String name)
- Specified by:
getIdentifierGenerator
in interfaceMetadata
-
collectTableMappings
public java.util.Collection<Table> collectTableMappings()
- Specified by:
collectTableMappings
in interfaceMetadata
-
getSqlFunctionMap
public java.util.Map<java.lang.String,SQLFunction> getSqlFunctionMap()
- Specified by:
getSqlFunctionMap
in interfaceMetadata
-
getMetadataBuildingOptions
public MetadataBuildingOptions getMetadataBuildingOptions()
Description copied from interface:MetadataImplementor
Access to the options used to build this Metadata- Specified by:
getMetadataBuildingOptions
in interfaceMetadataImplementor
- Returns:
- Access to the MetadataBuildingOptions
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:MetadataImplementor
Access to the TypeConfiguration- Specified by:
getTypeConfiguration
in interfaceMetadataImplementor
- Returns:
- Access to the TypeConfiguration
-
getTypeResolver
@Deprecated public TypeResolver getTypeResolver()
Deprecated.(since 5.3) No replacement, access to and handling of Types will be much different in 6.0Retrieve theType
resolver associated with this factory.- Specified by:
getTypeResolver
in interfaceMetadataImplementor
- Returns:
- The type resolver
-
buildNamedQueryRepository
public NamedQueryRepository buildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)
- Specified by:
buildNamedQueryRepository
in interfaceMetadataImplementor
-
validate
public void validate() throws MappingException
- Specified by:
validate
in interfaceMetadataImplementor
- Throws:
MappingException
-
getMappedSuperclassMappingsCopy
public java.util.Set<MappedSuperclass> getMappedSuperclassMappingsCopy()
- Specified by:
getMappedSuperclassMappingsCopy
in interfaceMetadataImplementor
-
initSessionFactory
public void initSessionFactory(SessionFactoryImplementor sessionFactory)
- Specified by:
initSessionFactory
in interfaceMetadataImplementor
-
-