Package org.hibernate.boot.spi
Interface InFlightMetadataCollector
-
- All Superinterfaces:
Mapping
,Metadata
,MetadataImplementor
- All Known Implementing Classes:
InFlightMetadataCollectorImpl
public interface InFlightMetadataCollector extends MetadataImplementor
An in-flight representation ofMetadata
while it is being built.- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
InFlightMetadataCollector.CollectionTypeRegistrationDescriptor
static interface
InFlightMetadataCollector.DelayedPropertyReferenceHandler
static class
InFlightMetadataCollector.DuplicateSecondaryTableException
static interface
InFlightMetadataCollector.EntityTableXref
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addAttributeConverter(Class<? extends AttributeConverter<?,?>> converterClass)
Deprecated.void
addAttributeConverter(ConverterDescriptor descriptor)
Deprecated.void
addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Add metadata pertaining to an auxiliary database object to this repository.AnnotatedClassType
addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
void
addCollectionBinding(Collection collection)
Add collection mapping metadata to this repository.void
addCollectionTypeRegistration(CollectionTypeRegistration registrationAnnotation)
void
addCollectionTypeRegistration(CollectionClassification classification, InFlightMetadataCollector.CollectionTypeRegistrationDescriptor descriptor)
void
addColumnNameBinding(Table table, String logicalColumnName, Column column)
void
addColumnNameBinding(Table table, Identifier logicalColumnName, Column column)
void
addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generatorDefinition)
void
addDefaultNamedNativeQuery(NamedNativeQueryDefinition query)
void
addDefaultNamedProcedureCall(NamedProcedureCallDefinitionImpl procedureCallDefinition)
void
addDefaultQuery(NamedHqlQueryDefinition queryDefinition)
void
addDefaultResultSetMapping(NamedResultSetMappingDescriptor definition)
void
addDelayedPropertyReferenceHandler(InFlightMetadataCollector.DelayedPropertyReferenceHandler handler)
Table
addDenormalizedTable(String schema, String catalog, String name, boolean isAbstract, String subselect, Table includedTable, MetadataBuildingContext buildingContext)
Adds a 'denormalized table' to this repository.void
addEntityBinding(PersistentClass persistentClass)
Add thePersistentClass
for an entity mapping.InFlightMetadataCollector.EntityTableXref
addEntityTableXref(String entityName, Identifier primaryTableLogicalName, Table primaryTable, InFlightMetadataCollector.EntityTableXref superEntityTableXref)
void
addFetchProfile(FetchProfile profile)
Add aFetchProfile
.void
addFilterDefinition(FilterDefinition definition)
Adds a filter definition to this repository.void
addIdentifierGenerator(IdentifierGeneratorDefinition generatorDefinition)
void
addImport(String importName, String className)
Adds an import (for use in HQL).void
addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd)
void
addJdbcTypeRegistration(int typeCode, JdbcType jdbcType)
void
addMappedBy(String name, String mappedBy, String propertyName)
void
addMappedSuperclass(Class<?> type, MappedSuperclass mappedSuperclass)
void
addNamedEntityGraph(NamedEntityGraphDefinition namedEntityGraphDefinition)
Adds metadata for a named entity graph to this repositoryvoid
addNamedNativeQuery(NamedNativeQueryDefinition query)
Adds metadata for a named SQL query to this collector.void
addNamedProcedureCallDefinition(NamedProcedureCallDefinition definition)
Adds metadata for a named stored procedure call to this collector.void
addNamedQuery(NamedHqlQueryDefinition query)
Adds metadata for a named query to this repository.void
addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entity, PropertyData propertyAnnotatedElement)
void
addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entity, PropertyData specJPropertyData, String s)
void
addPropertyReference(String entityName, String propertyName)
void
addPropertyReferencedAssociation(String s, String propertyName, String syntheticPropertyName)
void
addRegisteredConversion(RegisteredConversion conversion)
Deprecated.void
addResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDefinition)
Adds the metadata for a named SQL result set mapping to this collector.void
addSecondPass(SecondPass secondPass)
void
addSecondPass(SecondPass sp, boolean onTopOfTheQueue)
Table
addTable(String schema, String catalog, String name, String subselect, boolean isAbstract, MetadataBuildingContext buildingContext)
Adds table metadata to this repository returning the created metadata instance.void
addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, Table denormalizedSuperTable)
void
addTableNameBinding(Identifier logicalName, Table table)
void
addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entity, PropertyData propertyAnnotatedElement)
void
addTypeDefinition(TypeDefinition typeDefinition)
Deprecated.UsegetTypeDefinitionRegistry()
insteadvoid
addUniquePropertyReference(String entityName, String propertyName)
InFlightMetadataCollector.CollectionTypeRegistrationDescriptor
findCollectionTypeRegistration(CollectionClassification classification)
Class<? extends CompositeUserType<?>>
findRegisteredCompositeUserType(Class<?> embeddableType)
Class<? extends EmbeddableInstantiator>
findRegisteredEmbeddableInstantiator(Class<?> embeddableType)
Class<? extends UserType<?>>
findRegisteredUserType(Class<?> basicType)
ConverterAutoApplyHandler
getAttributeConverterAutoApplyHandler()
Deprecated.BootstrapContext
getBootstrapContext()
AnnotatedClassType
getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
ConverterRegistry
getConverterRegistry()
Obtain theConverterRegistry
which may be used to registerAttributeConverter
s.List<org.hibernate.annotations.common.reflection.XClass>
getEmbeddableSubclasses(org.hibernate.annotations.common.reflection.XClass superclass)
Map<String,PersistentClass>
getEntityBindingMap()
A map ofPersistentClass
by entity name.InFlightMetadataCollector.EntityTableXref
getEntityTableXref(String entityName)
String
getFromMappedBy(String ownerEntityName, String propertyName)
Map<String,Join>
getJoins(String entityName)
String
getLogicalColumnName(Table table, String physicalName)
String
getLogicalColumnName(Table table, Identifier physicalName)
String
getLogicalTableName(Table ownerTable)
MappedSuperclass
getMappedSuperclass(Class<?> type)
String
getPhysicalColumnName(Table table, String logicalName)
String
getPhysicalColumnName(Table table, Identifier logicalName)
String
getPhysicalTableName(String logicalName)
String
getPhysicalTableName(Identifier logicalName)
PropertyData
getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass persistentXClass, String propertyName)
PropertyData
getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass persistentXClass, String propertyName)
String
getPropertyReferencedAssociation(String entityName, String mappedBy)
TypeDefinitionRegistry
getTypeDefinitionRegistry()
Access to theTypeDefinitionRegistry
, which may be used to add type definitions to this metadata repository.boolean
isInSecondPass()
NaturalIdUniqueKeyBinder
locateNaturalIdUniqueKeyBinder(String entityName)
void
registerComponent(Component component)
void
registerCompositeUserType(Class<?> embeddableType, Class<? extends CompositeUserType<?>> userType)
void
registerEmbeddableInstantiator(Class<?> embeddableType, Class<? extends EmbeddableInstantiator> instantiator)
void
registerEmbeddableSubclass(org.hibernate.annotations.common.reflection.XClass superclass, org.hibernate.annotations.common.reflection.XClass subclass)
void
registerGenericComponent(Component component)
void
registerNaturalIdUniqueKeyBinder(String entityName, NaturalIdUniqueKeyBinder ukBinder)
void
registerUserType(Class<?> embeddableType, Class<? extends UserType<?>> userType)
void
registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver)
-
Methods inherited from interface org.hibernate.engine.spi.Mapping
getIdentifierPropertyName, getIdentifierType, getReferencedPropertyType
-
Methods inherited from interface org.hibernate.boot.Metadata
buildSessionFactory, collectTableMappings, getCollectionBinding, getCollectionBindings, getContributors, getDatabase, getEntityBinding, getEntityBindings, getFetchProfile, getFetchProfiles, getFilterDefinition, getFilterDefinitions, getIdentifierGenerator, getImports, getNamedEntityGraph, getNamedEntityGraphs, getNamedHqlQueryMapping, getNamedNativeQueryMapping, getNamedProcedureCallMapping, getResultSetMapping, getSessionFactoryBuilder, getSqlFunctionMap, getTypeDefinition, getUUID, visitNamedHqlQueryDefinitions, visitNamedNativeQueryDefinitions, visitNamedProcedureCallDefinition, visitNamedResultSetMappingDefinition
-
Methods inherited from interface org.hibernate.boot.spi.MetadataImplementor
buildNamedQueryRepository, getFunctionRegistry, getGenericComponent, getMappedSuperclassMappingsCopy, getMetadataBuildingOptions, getTypeConfiguration, initSessionFactory, orderColumns, resolveEmbeddableDiscriminatorType, validate, visitRegisteredComponents
-
-
-
-
Method Detail
-
getBootstrapContext
BootstrapContext getBootstrapContext()
-
addEntityBinding
void addEntityBinding(PersistentClass persistentClass) throws DuplicateMappingException
Add thePersistentClass
for an entity mapping.- Parameters:
persistentClass
- The entity metadata- Throws:
DuplicateMappingException
- Indicates there was already an entry corresponding to the given entity name.
-
getEntityBindingMap
Map<String,PersistentClass> getEntityBindingMap()
A map ofPersistentClass
by entity name. Needed forSecondPass
handling.
-
registerComponent
void registerComponent(Component component)
-
registerGenericComponent
void registerGenericComponent(Component component)
-
registerEmbeddableSubclass
void registerEmbeddableSubclass(org.hibernate.annotations.common.reflection.XClass superclass, org.hibernate.annotations.common.reflection.XClass subclass)
-
getEmbeddableSubclasses
List<org.hibernate.annotations.common.reflection.XClass> getEmbeddableSubclasses(org.hibernate.annotations.common.reflection.XClass superclass)
-
addImport
void addImport(String importName, String className) throws DuplicateMappingException
Adds an import (for use in HQL).- Parameters:
importName
- The name to be used in HQLclassName
- The fully-qualified name of the class- Throws:
DuplicateMappingException
- If className already is mapped to another entity name in this repository.
-
addCollectionBinding
void addCollectionBinding(Collection collection) throws DuplicateMappingException
Add collection mapping metadata to this repository.- Parameters:
collection
- The collection metadata- Throws:
DuplicateMappingException
- Indicates there was already an entry corresponding to the given collection role
-
addTable
Table addTable(String schema, String catalog, String name, String subselect, boolean isAbstract, MetadataBuildingContext buildingContext)
Adds table metadata to this repository returning the created metadata instance.- Parameters:
schema
- The named schema in which the table belongs (or null).catalog
- The named catalog in which the table belongs (or null).name
- The table namesubselect
- A select statement which defines a logical table, much like a DB view.isAbstract
- Is the table abstract (i.e. not really existing in the DB)?- Returns:
- The created table metadata, or the existing reference.
-
addDenormalizedTable
Table addDenormalizedTable(String schema, String catalog, String name, boolean isAbstract, String subselect, Table includedTable, MetadataBuildingContext buildingContext) throws DuplicateMappingException
Adds a 'denormalized table' to this repository.- Parameters:
schema
- The named schema in which the table belongs (or null).catalog
- The named catalog in which the table belongs (or null).name
- The table nameisAbstract
- Is the table abstract (i.e. not really existing in the DB)?subselect
- A select statement which defines a logical table, much like a DB view.includedTable
- The "common" table- Returns:
- The created table metadata.
- Throws:
DuplicateMappingException
- If such a table mapping already exists.
-
addNamedQuery
void addNamedQuery(NamedHqlQueryDefinition query) throws DuplicateMappingException
Adds metadata for a named query to this repository.- Parameters:
query
- The metadata- Throws:
DuplicateMappingException
- If a query already exists with that name.
-
addNamedNativeQuery
void addNamedNativeQuery(NamedNativeQueryDefinition query) throws DuplicateMappingException
Adds metadata for a named SQL query to this collector.- Throws:
DuplicateMappingException
-
addResultSetMapping
void addResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDefinition) throws DuplicateMappingException
Adds the metadata for a named SQL result set mapping to this collector.- Throws:
DuplicateMappingException
-
addNamedProcedureCallDefinition
void addNamedProcedureCallDefinition(NamedProcedureCallDefinition definition) throws DuplicateMappingException
Adds metadata for a named stored procedure call to this collector.- Throws:
DuplicateMappingException
-
addNamedEntityGraph
void addNamedEntityGraph(NamedEntityGraphDefinition namedEntityGraphDefinition)
Adds metadata for a named entity graph to this repository- Parameters:
namedEntityGraphDefinition
- The procedure call information- Throws:
DuplicateMappingException
- If an entity graph already exists with that name.
-
addTypeDefinition
@Deprecated void addTypeDefinition(TypeDefinition typeDefinition)
Deprecated.UsegetTypeDefinitionRegistry()
insteadAdds a type definition to this metadata repository.- Parameters:
typeDefinition
- The named type definition to add.- Throws:
DuplicateMappingException
- If aTypeDefinition
already exists with that name.- See Also:
getTypeDefinitionRegistry()
-
getTypeDefinitionRegistry
TypeDefinitionRegistry getTypeDefinitionRegistry()
Access to theTypeDefinitionRegistry
, which may be used to add type definitions to this metadata repository.
-
addFilterDefinition
void addFilterDefinition(FilterDefinition definition)
Adds a filter definition to this repository.- Parameters:
definition
- The filter definition to add.- Throws:
DuplicateMappingException
- If aFilterDefinition
already exists with that name.
-
addAuxiliaryDatabaseObject
void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Add metadata pertaining to an auxiliary database object to this repository.- Parameters:
auxiliaryDatabaseObject
- The metadata.
-
addFetchProfile
void addFetchProfile(FetchProfile profile)
Add aFetchProfile
.
-
addIdentifierGenerator
void addIdentifierGenerator(IdentifierGeneratorDefinition generatorDefinition)
-
getConverterRegistry
ConverterRegistry getConverterRegistry()
Obtain theConverterRegistry
which may be used to registerAttributeConverter
s.
-
addAttributeConverter
@Deprecated(since="6.2") void addAttributeConverter(ConverterDescriptor descriptor)
Deprecated.Apply the descriptor for anAttributeConverter
-
addAttributeConverter
@Deprecated(since="6.2") void addAttributeConverter(Class<? extends AttributeConverter<?,?>> converterClass)
Deprecated.Apply anAttributeConverter
-
addRegisteredConversion
@Deprecated(since="6.2") void addRegisteredConversion(RegisteredConversion conversion)
Deprecated.
-
getAttributeConverterAutoApplyHandler
@Deprecated(since="6.2") ConverterAutoApplyHandler getAttributeConverterAutoApplyHandler()
Deprecated.
-
addSecondPass
void addSecondPass(SecondPass secondPass)
-
addSecondPass
void addSecondPass(SecondPass sp, boolean onTopOfTheQueue)
-
addTableNameBinding
void addTableNameBinding(Identifier logicalName, Table table)
-
addTableNameBinding
void addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, Table denormalizedSuperTable)
-
getPhysicalTableName
String getPhysicalTableName(Identifier logicalName)
-
addColumnNameBinding
void addColumnNameBinding(Table table, Identifier logicalColumnName, Column column)
-
addColumnNameBinding
void addColumnNameBinding(Table table, String logicalColumnName, Column column)
-
getPhysicalColumnName
String getPhysicalColumnName(Table table, Identifier logicalName) throws MappingException
- Throws:
MappingException
-
getPhysicalColumnName
String getPhysicalColumnName(Table table, String logicalName) throws MappingException
- Throws:
MappingException
-
getLogicalColumnName
String getLogicalColumnName(Table table, Identifier physicalName)
-
addDefaultIdentifierGenerator
void addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generatorDefinition)
-
addDefaultQuery
void addDefaultQuery(NamedHqlQueryDefinition queryDefinition)
-
addDefaultNamedNativeQuery
void addDefaultNamedNativeQuery(NamedNativeQueryDefinition query)
-
addDefaultResultSetMapping
void addDefaultResultSetMapping(NamedResultSetMappingDescriptor definition)
-
addDefaultNamedProcedureCall
void addDefaultNamedProcedureCall(NamedProcedureCallDefinitionImpl procedureCallDefinition)
-
addClassType
AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
-
getClassType
AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
-
addMappedSuperclass
void addMappedSuperclass(Class<?> type, MappedSuperclass mappedSuperclass)
-
getMappedSuperclass
MappedSuperclass getMappedSuperclass(Class<?> type)
-
getPropertyAnnotatedWithMapsId
PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass persistentXClass, String propertyName)
-
addPropertyAnnotatedWithMapsId
void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entity, PropertyData propertyAnnotatedElement)
-
addPropertyAnnotatedWithMapsIdSpecj
void addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entity, PropertyData specJPropertyData, String s)
-
addToOneAndIdProperty
void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entity, PropertyData propertyAnnotatedElement)
-
getPropertyAnnotatedWithIdAndToOne
PropertyData getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass persistentXClass, String propertyName)
-
isInSecondPass
boolean isInSecondPass()
-
locateNaturalIdUniqueKeyBinder
NaturalIdUniqueKeyBinder locateNaturalIdUniqueKeyBinder(String entityName)
-
registerNaturalIdUniqueKeyBinder
void registerNaturalIdUniqueKeyBinder(String entityName, NaturalIdUniqueKeyBinder ukBinder)
-
registerValueMappingResolver
void registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver)
-
addJdbcTypeRegistration
void addJdbcTypeRegistration(int typeCode, JdbcType jdbcType)
-
registerEmbeddableInstantiator
void registerEmbeddableInstantiator(Class<?> embeddableType, Class<? extends EmbeddableInstantiator> instantiator)
-
findRegisteredEmbeddableInstantiator
Class<? extends EmbeddableInstantiator> findRegisteredEmbeddableInstantiator(Class<?> embeddableType)
-
registerCompositeUserType
void registerCompositeUserType(Class<?> embeddableType, Class<? extends CompositeUserType<?>> userType)
-
findRegisteredCompositeUserType
Class<? extends CompositeUserType<?>> findRegisteredCompositeUserType(Class<?> embeddableType)
-
registerUserType
void registerUserType(Class<?> embeddableType, Class<? extends UserType<?>> userType)
-
addCollectionTypeRegistration
void addCollectionTypeRegistration(CollectionTypeRegistration registrationAnnotation)
-
addCollectionTypeRegistration
void addCollectionTypeRegistration(CollectionClassification classification, InFlightMetadataCollector.CollectionTypeRegistrationDescriptor descriptor)
-
findCollectionTypeRegistration
InFlightMetadataCollector.CollectionTypeRegistrationDescriptor findCollectionTypeRegistration(CollectionClassification classification)
-
addDelayedPropertyReferenceHandler
void addDelayedPropertyReferenceHandler(InFlightMetadataCollector.DelayedPropertyReferenceHandler handler)
-
addPropertyReferencedAssociation
void addPropertyReferencedAssociation(String s, String propertyName, String syntheticPropertyName)
-
getPropertyReferencedAssociation
String getPropertyReferencedAssociation(String entityName, String mappedBy)
-
getEntityTableXref
InFlightMetadataCollector.EntityTableXref getEntityTableXref(String entityName)
-
addEntityTableXref
InFlightMetadataCollector.EntityTableXref addEntityTableXref(String entityName, Identifier primaryTableLogicalName, Table primaryTable, InFlightMetadataCollector.EntityTableXref superEntityTableXref)
-
-