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 ofMetadataImplementorusing delegation.
-
-
Constructor Summary
Constructors Constructor Description AbstractDelegatingMetadata(MetadataImplementor delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description NamedQueryRepositorybuildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)SessionFactorybuildSessionFactory()Short-hand form of building aSessionFactorythrough the builder without any additional option overrides.java.util.Collection<Table>collectTableMappings()protected MetadataImplementordelegate()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)IdentifierGeneratorFactorygetIdentifierGeneratorFactory()Allow access to the id generator factory, though this is only needed/allowed from configuration.java.lang.StringgetIdentifierPropertyName(java.lang.String className)TypegetIdentifierType(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()MetadataBuildingOptionsgetMetadataBuildingOptions()Access to the options used to build this MetadataNamedEntityGraphDefinitiongetNamedEntityGraph(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()TypegetReferencedPropertyType(java.lang.String className, java.lang.String propertyName)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()TypeConfigurationgetTypeConfiguration()Access to the TypeConfigurationTypeDefinitiongetTypeDefinition(java.lang.String typeName)Retrieve a type definition by name.TypeResolvergetTypeResolver()Deprecated.(since 5.3) No replacement, access to and handling of Types will be much different in 6.0java.util.UUIDgetUUID()Gets theUUIDfor this metamodel.voidinitSessionFactory(SessionFactoryImplementor sessionFactory)voidvalidate()
-
-
-
Constructor Detail
-
AbstractDelegatingMetadata
public AbstractDelegatingMetadata(MetadataImplementor delegate)
-
-
Method Detail
-
delegate
protected MetadataImplementor delegate()
-
getIdentifierGeneratorFactory
public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Description copied from interface:MappingAllow access to the id generator factory, though this is only needed/allowed from configuration.- Specified by:
getIdentifierGeneratorFactoryin interfaceMapping- Returns:
- Access to the identifier generator factory
-
getIdentifierType
public Type getIdentifierType(java.lang.String className) throws MappingException
- Specified by:
getIdentifierTypein interfaceMapping- Throws:
MappingException
-
getIdentifierPropertyName
public java.lang.String getIdentifierPropertyName(java.lang.String className) throws MappingException- Specified by:
getIdentifierPropertyNamein interfaceMapping- Throws:
MappingException
-
getReferencedPropertyType
public Type getReferencedPropertyType(java.lang.String className, java.lang.String propertyName) throws MappingException
- Specified by:
getReferencedPropertyTypein interfaceMapping- Throws:
MappingException
-
getSessionFactoryBuilder
public SessionFactoryBuilder getSessionFactoryBuilder()
Description copied from interface:MetadataGet the builder forSessionFactoryinstances based on this metamodel.- Specified by:
getSessionFactoryBuilderin interfaceMetadata- Returns:
- The builder for
SessionFactoryinstances.
-
buildSessionFactory
public SessionFactory buildSessionFactory()
Description copied from interface:MetadataShort-hand form of building aSessionFactorythrough the builder without any additional option overrides.- Specified by:
buildSessionFactoryin interfaceMetadata- Returns:
- THe built SessionFactory.
-
getUUID
public java.util.UUID getUUID()
Description copied from interface:MetadataGets theUUIDfor this metamodel.
-
getDatabase
public Database getDatabase()
Description copied from interface:MetadataRetrieve the database model.- Specified by:
getDatabasein interfaceMetadata- Returns:
- The database model.
-
getEntityBindings
public java.util.Collection<PersistentClass> getEntityBindings()
Description copied from interface:MetadataRetrieves the PersistentClass entity metadata representation for all known entities. Returned collection is immutable- Specified by:
getEntityBindingsin interfaceMetadata- Returns:
- All PersistentClass representations.
-
getEntityBinding
public PersistentClass getEntityBinding(java.lang.String entityName)
Description copied from interface:MetadataRetrieves the PersistentClass entity mapping metadata representation for the given entity name.- Specified by:
getEntityBindingin interfaceMetadata- Parameters:
entityName- The entity name for which to retrieve the metadata.- Returns:
- The entity mapping metadata, or
nullif no matching entity found.
-
getCollectionBindings
public java.util.Collection<Collection> getCollectionBindings()
Description copied from interface:MetadataRetrieves the Collection metadata representation for all known collections. Returned collection is immutable- Specified by:
getCollectionBindingsin interfaceMetadata- Returns:
- All Collection representations.
-
getCollectionBinding
public Collection getCollectionBinding(java.lang.String role)
Description copied from interface:MetadataRetrieves the collection mapping metadata for the given collection role.- Specified by:
getCollectionBindingin interfaceMetadata- Parameters:
role- The collection role for which to retrieve the metadata.- Returns:
- The collection mapping metadata, or
nullif no matching collection found.
-
getImports
public java.util.Map<java.lang.String,java.lang.String> getImports()
Description copied from interface:MetadataRetrieves all defined imports (class renames).- Specified by:
getImportsin interfaceMetadata- Returns:
- All imports
-
getNamedQueryDefinition
public NamedQueryDefinition getNamedQueryDefinition(java.lang.String name)
Description copied from interface:MetadataRetrieve named query metadata by name.- Specified by:
getNamedQueryDefinitionin interfaceMetadata- Parameters:
name- The query name- Returns:
- The named query metadata, or
null.
-
getNamedQueryDefinitions
public java.util.Collection<NamedQueryDefinition> getNamedQueryDefinitions()
- Specified by:
getNamedQueryDefinitionsin interfaceMetadata
-
getNamedNativeQueryDefinition
public NamedSQLQueryDefinition getNamedNativeQueryDefinition(java.lang.String name)
Description copied from interface:MetadataRetrieve named SQL query metadata.- Specified by:
getNamedNativeQueryDefinitionin interfaceMetadata- Parameters:
name- The SQL query name.- Returns:
- The named query metadata, or
null
-
getNamedNativeQueryDefinitions
public java.util.Collection<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
- Specified by:
getNamedNativeQueryDefinitionsin interfaceMetadata
-
getNamedProcedureCallDefinitions
public java.util.Collection<NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
- Specified by:
getNamedProcedureCallDefinitionsin interfaceMetadata
-
getResultSetMapping
public ResultSetMappingDefinition getResultSetMapping(java.lang.String name)
Description copied from interface:MetadataRetrieve the metadata for a named SQL result set mapping.- Specified by:
getResultSetMappingin interfaceMetadata- Parameters:
name- The mapping name.- Returns:
- The named result set mapping metadata, or
nullif none found.
-
getResultSetMappingDefinitions
public java.util.Map<java.lang.String,ResultSetMappingDefinition> getResultSetMappingDefinitions()
- Specified by:
getResultSetMappingDefinitionsin interfaceMetadata
-
getTypeDefinition
public TypeDefinition getTypeDefinition(java.lang.String typeName)
Description copied from interface:MetadataRetrieve a type definition by name.- Specified by:
getTypeDefinitionin 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:MetadataRetrieves the complete map of filter definitions. Returned map is immutable- Specified by:
getFilterDefinitionsin interfaceMetadata- Returns:
- The filter definition map.
-
getFilterDefinition
public FilterDefinition getFilterDefinition(java.lang.String name)
Description copied from interface:MetadataRetrieves a filter definition by name.- Specified by:
getFilterDefinitionin 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:
getFetchProfilein interfaceMetadata
-
getFetchProfiles
public java.util.Collection<FetchProfile> getFetchProfiles()
- Specified by:
getFetchProfilesin interfaceMetadata
-
getNamedEntityGraph
public NamedEntityGraphDefinition getNamedEntityGraph(java.lang.String name)
- Specified by:
getNamedEntityGraphin interfaceMetadata
-
getNamedEntityGraphs
public java.util.Map<java.lang.String,NamedEntityGraphDefinition> getNamedEntityGraphs()
- Specified by:
getNamedEntityGraphsin interfaceMetadata
-
getIdentifierGenerator
public IdentifierGeneratorDefinition getIdentifierGenerator(java.lang.String name)
- Specified by:
getIdentifierGeneratorin interfaceMetadata
-
collectTableMappings
public java.util.Collection<Table> collectTableMappings()
- Specified by:
collectTableMappingsin interfaceMetadata
-
getSqlFunctionMap
public java.util.Map<java.lang.String,SQLFunction> getSqlFunctionMap()
- Specified by:
getSqlFunctionMapin interfaceMetadata
-
getMetadataBuildingOptions
public MetadataBuildingOptions getMetadataBuildingOptions()
Description copied from interface:MetadataImplementorAccess to the options used to build this Metadata- Specified by:
getMetadataBuildingOptionsin interfaceMetadataImplementor- Returns:
- Access to the MetadataBuildingOptions
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:MetadataImplementorAccess to the TypeConfiguration- Specified by:
getTypeConfigurationin 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 theTyperesolver associated with this factory.- Specified by:
getTypeResolverin interfaceMetadataImplementor- Returns:
- The type resolver
-
buildNamedQueryRepository
public NamedQueryRepository buildNamedQueryRepository(org.hibernate.internal.SessionFactoryImpl sessionFactory)
- Specified by:
buildNamedQueryRepositoryin interfaceMetadataImplementor
-
validate
public void validate() throws MappingException- Specified by:
validatein interfaceMetadataImplementor- Throws:
MappingException
-
getMappedSuperclassMappingsCopy
public java.util.Set<MappedSuperclass> getMappedSuperclassMappingsCopy()
- Specified by:
getMappedSuperclassMappingsCopyin interfaceMetadataImplementor
-
initSessionFactory
public void initSessionFactory(SessionFactoryImplementor sessionFactory)
- Specified by:
initSessionFactoryin interfaceMetadataImplementor
-
-