Package org.hibernate.boot.internal
Class InFlightMetadataCollectorImpl
- java.lang.Object
-
- org.hibernate.boot.internal.InFlightMetadataCollectorImpl
-
- All Implemented Interfaces:
Metadata
,ConverterRegistry
,InFlightMetadataCollector
,MetadataImplementor
,Mapping
public class InFlightMetadataCollectorImpl extends Object implements InFlightMetadataCollector, ConverterRegistry
The implementation of the in-flight metadata collector contract.The usage expectation is that this class is used until all Metadata info is collected and then
buildMetadataInstance(org.hibernate.boot.spi.MetadataBuildingContext)
is called to generate the complete (and immutable) Metadata object.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.boot.spi.InFlightMetadataCollector
InFlightMetadataCollector.CollectionTypeRegistrationDescriptor, InFlightMetadataCollector.DelayedPropertyReferenceHandler, InFlightMetadataCollector.DuplicateSecondaryTableException, InFlightMetadataCollector.EntityTableXref
-
-
Constructor Summary
Constructors Constructor Description InFlightMetadataCollectorImpl(BootstrapContext bootstrapContext, MetadataBuildingOptions options)
-
Method Summary
-
-
-
Constructor Detail
-
InFlightMetadataCollectorImpl
public InFlightMetadataCollectorImpl(BootstrapContext bootstrapContext, MetadataBuildingOptions options)
-
-
Method Detail
-
getUUID
public UUID getUUID()
Description copied from interface:Metadata
Gets theUUID
for this metamodel.
-
getMetadataBuildingOptions
public MetadataBuildingOptions getMetadataBuildingOptions()
Description copied from interface:MetadataImplementor
Access to the options used to build thisMetadata
- Specified by:
getMetadataBuildingOptions
in interfaceMetadataImplementor
- Returns:
- The
MetadataBuildingOptions
-
getBootstrapContext
public BootstrapContext getBootstrapContext()
- Specified by:
getBootstrapContext
in interfaceInFlightMetadataCollector
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:MetadataImplementor
Access to theTypeConfiguration
belonging to theBootstrapContext
- Specified by:
getTypeConfiguration
in interfaceMetadataImplementor
-
getFunctionRegistry
public SqmFunctionRegistry getFunctionRegistry()
Description copied from interface:MetadataImplementor
Access to theSqmFunctionRegistry
belonging to theBootstrapContext
- Specified by:
getFunctionRegistry
in interfaceMetadataImplementor
-
getDatabase
public Database getDatabase()
Description copied from interface:Metadata
Retrieve the database model.- Specified by:
getDatabase
in interfaceMetadata
- Returns:
- The database model.
-
buildNamedQueryRepository
public NamedObjectRepository buildNamedQueryRepository(SessionFactoryImplementor sessionFactory)
- Specified by:
buildNamedQueryRepository
in interfaceMetadataImplementor
-
getSqlFunctionMap
public Map<String,SqmFunctionDescriptor> getSqlFunctionMap()
- Specified by:
getSqlFunctionMap
in interfaceMetadata
-
getContributors
public Set<String> getContributors()
Description copied from interface:Metadata
All of the known model contributors- Specified by:
getContributors
in interfaceMetadata
-
orderColumns
public void orderColumns(boolean forceOrdering)
- Specified by:
orderColumns
in interfaceMetadataImplementor
-
validate
public void validate() throws MappingException
- Specified by:
validate
in interfaceMetadataImplementor
- Throws:
MappingException
-
getMappedSuperclassMappingsCopy
public Set<MappedSuperclass> getMappedSuperclassMappingsCopy()
- Specified by:
getMappedSuperclassMappingsCopy
in interfaceMetadataImplementor
-
initSessionFactory
public void initSessionFactory(SessionFactoryImplementor sessionFactory)
- Specified by:
initSessionFactory
in interfaceMetadataImplementor
-
registerComponent
public void registerComponent(Component component)
- Specified by:
registerComponent
in interfaceInFlightMetadataCollector
-
visitRegisteredComponents
public void visitRegisteredComponents(Consumer<Component> consumer)
- Specified by:
visitRegisteredComponents
in interfaceMetadataImplementor
-
registerGenericComponent
public void registerGenericComponent(Component component)
- Specified by:
registerGenericComponent
in interfaceInFlightMetadataCollector
-
getGenericComponent
public Component getGenericComponent(Class<?> componentClass)
- Specified by:
getGenericComponent
in interfaceMetadataImplementor
-
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.
-
getEntityBindings
public 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.
-
getEntityBindingMap
public Map<String,PersistentClass> getEntityBindingMap()
Description copied from interface:InFlightMetadataCollector
Needed for SecondPass handling- Specified by:
getEntityBindingMap
in interfaceInFlightMetadataCollector
-
getEntityBinding
public PersistentClass getEntityBinding(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.
-
addEntityBinding
public void addEntityBinding(PersistentClass persistentClass) throws DuplicateMappingException
Description copied from interface:InFlightMetadataCollector
Add the PersistentClass for an entity mapping.- Specified by:
addEntityBinding
in interfaceInFlightMetadataCollector
- Parameters:
persistentClass
- The entity metadata- Throws:
DuplicateMappingException
- Indicates there was already an entry corresponding to the given entity name.
-
getCollectionBindings
public 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(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.
-
addCollectionBinding
public void addCollectionBinding(Collection collection) throws DuplicateMappingException
Description copied from interface:InFlightMetadataCollector
Add collection mapping metadata to this repository.- Specified by:
addCollectionBinding
in interfaceInFlightMetadataCollector
- Parameters:
collection
- The collection metadata- Throws:
DuplicateMappingException
- Indicates there was already an entry corresponding to the given collection role
-
getTypeDefinitionRegistry
public TypeDefinitionRegistry getTypeDefinitionRegistry()
Description copied from interface:InFlightMetadataCollector
Access to theTypeDefinitionRegistry
, which may be used to add type definitions to this metadata repository.- Specified by:
getTypeDefinitionRegistry
in interfaceInFlightMetadataCollector
-
getTypeDefinition
public TypeDefinition getTypeDefinition(String registrationKey)
Description copied from interface:Metadata
Retrieve a type definition by name.- Specified by:
getTypeDefinition
in interfaceMetadata
- Returns:
- The named type definition, or
null
-
addTypeDefinition
public void addTypeDefinition(TypeDefinition typeDefinition)
Description copied from interface:InFlightMetadataCollector
Adds a type definition to this metadata repository.- Specified by:
addTypeDefinition
in interfaceInFlightMetadataCollector
- Parameters:
typeDefinition
- The named type definition to add.- See Also:
InFlightMetadataCollector.getTypeDefinitionRegistry()
-
registerValueMappingResolver
public void registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver)
- Specified by:
registerValueMappingResolver
in interfaceInFlightMetadataCollector
-
addJavaTypeRegistration
public void addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd)
- Specified by:
addJavaTypeRegistration
in interfaceInFlightMetadataCollector
-
addJdbcTypeRegistration
public void addJdbcTypeRegistration(int typeCode, JdbcType jdbcType)
- Specified by:
addJdbcTypeRegistration
in interfaceInFlightMetadataCollector
-
registerEmbeddableInstantiator
public void registerEmbeddableInstantiator(Class<?> embeddableType, Class<? extends EmbeddableInstantiator> instantiator)
- Specified by:
registerEmbeddableInstantiator
in interfaceInFlightMetadataCollector
-
findRegisteredEmbeddableInstantiator
public Class<? extends EmbeddableInstantiator> findRegisteredEmbeddableInstantiator(Class<?> embeddableType)
- Specified by:
findRegisteredEmbeddableInstantiator
in interfaceInFlightMetadataCollector
-
registerCompositeUserType
public void registerCompositeUserType(Class<?> embeddableType, Class<? extends CompositeUserType<?>> userType)
- Specified by:
registerCompositeUserType
in interfaceInFlightMetadataCollector
-
findRegisteredCompositeUserType
public Class<? extends CompositeUserType<?>> findRegisteredCompositeUserType(Class<?> embeddableType)
- Specified by:
findRegisteredCompositeUserType
in interfaceInFlightMetadataCollector
-
registerUserType
public void registerUserType(Class<?> basicType, Class<? extends UserType<?>> userType)
- Specified by:
registerUserType
in interfaceInFlightMetadataCollector
-
findRegisteredUserType
public Class<? extends UserType<?>> findRegisteredUserType(Class<?> basicType)
- Specified by:
findRegisteredUserType
in interfaceInFlightMetadataCollector
-
addCollectionTypeRegistration
public void addCollectionTypeRegistration(CollectionTypeRegistration registrationAnnotation)
- Specified by:
addCollectionTypeRegistration
in interfaceInFlightMetadataCollector
-
addCollectionTypeRegistration
public void addCollectionTypeRegistration(CollectionClassification classification, InFlightMetadataCollector.CollectionTypeRegistrationDescriptor descriptor)
- Specified by:
addCollectionTypeRegistration
in interfaceInFlightMetadataCollector
-
findCollectionTypeRegistration
public InFlightMetadataCollector.CollectionTypeRegistrationDescriptor findCollectionTypeRegistration(CollectionClassification classification)
- Specified by:
findCollectionTypeRegistration
in interfaceInFlightMetadataCollector
-
getConverterRegistry
public ConverterRegistry getConverterRegistry()
Description copied from interface:InFlightMetadataCollector
Obtain theConverterRegistry
which may be used to registerAttributeConverter
s.- Specified by:
getConverterRegistry
in interfaceInFlightMetadataCollector
-
addAttributeConverter
public void addAttributeConverter(Class<? extends AttributeConverter<?,?>> converterClass)
Description copied from interface:InFlightMetadataCollector
Apply anAttributeConverter
- Specified by:
addAttributeConverter
in interfaceConverterRegistry
- Specified by:
addAttributeConverter
in interfaceInFlightMetadataCollector
-
addOverridableConverter
public void addOverridableConverter(Class<? extends AttributeConverter<?,?>> converterClass)
Description copied from interface:ConverterRegistry
Apply anAttributeConverter
that may be overridden by competing converters- Specified by:
addOverridableConverter
in interfaceConverterRegistry
-
addAttributeConverter
public void addAttributeConverter(ConverterDescriptor descriptor)
Description copied from interface:InFlightMetadataCollector
Apply the descriptor for anAttributeConverter
- Specified by:
addAttributeConverter
in interfaceConverterRegistry
- Specified by:
addAttributeConverter
in interfaceInFlightMetadataCollector
-
addRegisteredConversion
public void addRegisteredConversion(RegisteredConversion conversion)
- Specified by:
addRegisteredConversion
in interfaceConverterRegistry
- Specified by:
addRegisteredConversion
in interfaceInFlightMetadataCollector
-
getAttributeConverterAutoApplyHandler
public ConverterAutoApplyHandler getAttributeConverterAutoApplyHandler()
- Specified by:
getAttributeConverterAutoApplyHandler
in interfaceConverterRegistry
- Specified by:
getAttributeConverterAutoApplyHandler
in interfaceInFlightMetadataCollector
-
getFilterDefinitions
public Map<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(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
.
-
addFilterDefinition
public void addFilterDefinition(FilterDefinition filterDefinition)
Description copied from interface:InFlightMetadataCollector
Adds a filter definition to this repository.- Specified by:
addFilterDefinition
in interfaceInFlightMetadataCollector
- Parameters:
filterDefinition
- The filter definition to add.
-
getFetchProfiles
public Collection<FetchProfile> getFetchProfiles()
- Specified by:
getFetchProfiles
in interfaceMetadata
-
getFetchProfile
public FetchProfile getFetchProfile(String name)
- Specified by:
getFetchProfile
in interfaceMetadata
-
addFetchProfile
public void addFetchProfile(FetchProfile profile)
Description copied from interface:InFlightMetadataCollector
Add aFetchProfile
.- Specified by:
addFetchProfile
in interfaceInFlightMetadataCollector
-
getIdentifierGenerator
public IdentifierGeneratorDefinition getIdentifierGenerator(String name)
- Specified by:
getIdentifierGenerator
in interfaceMetadata
-
collectTableMappings
public Collection<Table> collectTableMappings()
- Specified by:
collectTableMappings
in interfaceMetadata
-
addIdentifierGenerator
public void addIdentifierGenerator(IdentifierGeneratorDefinition generator)
- Specified by:
addIdentifierGenerator
in interfaceInFlightMetadataCollector
-
addDefaultIdentifierGenerator
public void addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generator)
- Specified by:
addDefaultIdentifierGenerator
in interfaceInFlightMetadataCollector
-
getNamedEntityGraph
public NamedEntityGraphDefinition getNamedEntityGraph(String name)
- Specified by:
getNamedEntityGraph
in interfaceMetadata
-
getNamedEntityGraphs
public Map<String,NamedEntityGraphDefinition> getNamedEntityGraphs()
- Specified by:
getNamedEntityGraphs
in interfaceMetadata
-
addNamedEntityGraph
public void addNamedEntityGraph(NamedEntityGraphDefinition definition)
Description copied from interface:InFlightMetadataCollector
Adds metadata for a named entity graph to this repository- Specified by:
addNamedEntityGraph
in interfaceInFlightMetadataCollector
- Parameters:
definition
- The procedure call information
-
getNamedHqlQueryMapping
public NamedHqlQueryDefinition getNamedHqlQueryMapping(String name)
Description copied from interface:Metadata
Retrieve named query metadata by name.- Specified by:
getNamedHqlQueryMapping
in interfaceMetadata
- Returns:
- The named query metadata, or
null
.
-
visitNamedHqlQueryDefinitions
public void visitNamedHqlQueryDefinitions(Consumer<NamedHqlQueryDefinition> definitionConsumer)
Description copied from interface:Metadata
Visit all named HQL query definitions- Specified by:
visitNamedHqlQueryDefinitions
in interfaceMetadata
-
addNamedQuery
public void addNamedQuery(NamedHqlQueryDefinition def)
Description copied from interface:InFlightMetadataCollector
Adds metadata for a named query to this repository.- Specified by:
addNamedQuery
in interfaceInFlightMetadataCollector
- Parameters:
def
- The metadata
-
addDefaultQuery
public void addDefaultQuery(NamedHqlQueryDefinition queryDefinition)
- Specified by:
addDefaultQuery
in interfaceInFlightMetadataCollector
-
getNamedNativeQueryMapping
public NamedNativeQueryDefinition getNamedNativeQueryMapping(String name)
Description copied from interface:Metadata
Retrieve named SQL query metadata.- Specified by:
getNamedNativeQueryMapping
in interfaceMetadata
- Returns:
- The named query metadata, or
null
-
visitNamedNativeQueryDefinitions
public void visitNamedNativeQueryDefinitions(Consumer<NamedNativeQueryDefinition> definitionConsumer)
Description copied from interface:Metadata
Visit all named native query definitions- Specified by:
visitNamedNativeQueryDefinitions
in interfaceMetadata
-
addNamedNativeQuery
public void addNamedNativeQuery(NamedNativeQueryDefinition def)
Description copied from interface:InFlightMetadataCollector
Adds metadata for a named SQL query to this collector.- Specified by:
addNamedNativeQuery
in interfaceInFlightMetadataCollector
-
addDefaultNamedNativeQuery
public void addDefaultNamedNativeQuery(NamedNativeQueryDefinition query)
- Specified by:
addDefaultNamedNativeQuery
in interfaceInFlightMetadataCollector
-
getNamedProcedureCallMapping
public NamedProcedureCallDefinition getNamedProcedureCallMapping(String name)
Description copied from interface:Metadata
Retrieve named procedure metadata.- Specified by:
getNamedProcedureCallMapping
in interfaceMetadata
- Returns:
- The named procedure metadata, or
null
-
visitNamedProcedureCallDefinition
public void visitNamedProcedureCallDefinition(Consumer<NamedProcedureCallDefinition> definitionConsumer)
Description copied from interface:Metadata
Visit all named callable query definitions- Specified by:
visitNamedProcedureCallDefinition
in interfaceMetadata
-
addNamedProcedureCallDefinition
public void addNamedProcedureCallDefinition(NamedProcedureCallDefinition definition)
Description copied from interface:InFlightMetadataCollector
Adds metadata for a named stored procedure call to this collector.- Specified by:
addNamedProcedureCallDefinition
in interfaceInFlightMetadataCollector
-
addDefaultNamedProcedureCall
public void addDefaultNamedProcedureCall(NamedProcedureCallDefinitionImpl definition)
- Specified by:
addDefaultNamedProcedureCall
in interfaceInFlightMetadataCollector
-
getResultSetMapping
public NamedResultSetMappingDescriptor getResultSetMapping(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.
-
visitNamedResultSetMappingDefinition
public void visitNamedResultSetMappingDefinition(Consumer<NamedResultSetMappingDescriptor> definitionConsumer)
Description copied from interface:Metadata
Visit all named SQL result set mapping definitions- Specified by:
visitNamedResultSetMappingDefinition
in interfaceMetadata
-
addResultSetMapping
public void addResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDescriptor)
Description copied from interface:InFlightMetadataCollector
Adds the metadata for a named SQL result set mapping to this collector.- Specified by:
addResultSetMapping
in interfaceInFlightMetadataCollector
-
applyResultSetMapping
public void applyResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDescriptor)
-
addDefaultResultSetMapping
public void addDefaultResultSetMapping(NamedResultSetMappingDescriptor definition)
- Specified by:
addDefaultResultSetMapping
in interfaceInFlightMetadataCollector
-
getImports
public Map<String,String> getImports()
Description copied from interface:Metadata
Retrieves all defined imports (class renames).- Specified by:
getImports
in interfaceMetadata
- Returns:
- All imports
-
addImport
public void addImport(String importName, String className)
Description copied from interface:InFlightMetadataCollector
Adds an import (for use in HQL).- Specified by:
addImport
in interfaceInFlightMetadataCollector
- Parameters:
importName
- The name to be used in HQLclassName
- The fully-qualified name of the class
-
addTable
public Table addTable(String schemaName, String catalogName, String name, String subselectFragment, boolean isAbstract, MetadataBuildingContext buildingContext)
Description copied from interface:InFlightMetadataCollector
Adds table metadata to this repository returning the created metadata instance.- Specified by:
addTable
in interfaceInFlightMetadataCollector
- Parameters:
schemaName
- The named schema in which the table belongs (or null).catalogName
- The named catalog in which the table belongs (or null).name
- The table namesubselectFragment
- 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
public Table addDenormalizedTable(String schemaName, String catalogName, String name, boolean isAbstract, String subselectFragment, Table includedTable, MetadataBuildingContext buildingContext) throws DuplicateMappingException
Description copied from interface:InFlightMetadataCollector
Adds a 'denormalized table' to this repository.- Specified by:
addDenormalizedTable
in interfaceInFlightMetadataCollector
- Parameters:
schemaName
- The named schema in which the table belongs (or null).catalogName
- 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)?subselectFragment
- 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.
-
getIdentifierType
public Type getIdentifierType(String entityName) throws MappingException
- Specified by:
getIdentifierType
in interfaceMapping
- Throws:
MappingException
-
getIdentifierPropertyName
public String getIdentifierPropertyName(String entityName) throws MappingException
- Specified by:
getIdentifierPropertyName
in interfaceMapping
- Throws:
MappingException
-
getReferencedPropertyType
public Type getReferencedPropertyType(String entityName, String propertyName) throws MappingException
- Specified by:
getReferencedPropertyType
in interfaceMapping
- Throws:
MappingException
-
addTableNameBinding
public void addTableNameBinding(Identifier logicalName, Table table)
- Specified by:
addTableNameBinding
in interfaceInFlightMetadataCollector
-
addTableNameBinding
public void addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, Table denormalizedSuperTable)
- Specified by:
addTableNameBinding
in interfaceInFlightMetadataCollector
-
getLogicalTableName
public String getLogicalTableName(Table ownerTable)
- Specified by:
getLogicalTableName
in interfaceInFlightMetadataCollector
-
getPhysicalTableName
public String getPhysicalTableName(Identifier logicalName)
- Specified by:
getPhysicalTableName
in interfaceInFlightMetadataCollector
-
getPhysicalTableName
public String getPhysicalTableName(String logicalName)
- Specified by:
getPhysicalTableName
in interfaceInFlightMetadataCollector
-
addColumnNameBinding
public void addColumnNameBinding(Table table, String logicalName, Column column) throws DuplicateMappingException
- Specified by:
addColumnNameBinding
in interfaceInFlightMetadataCollector
- Throws:
DuplicateMappingException
-
addColumnNameBinding
public void addColumnNameBinding(Table table, Identifier logicalName, Column column) throws DuplicateMappingException
- Specified by:
addColumnNameBinding
in interfaceInFlightMetadataCollector
- Throws:
DuplicateMappingException
-
getPhysicalColumnName
public String getPhysicalColumnName(Table table, String logicalName) throws MappingException
- Specified by:
getPhysicalColumnName
in interfaceInFlightMetadataCollector
- Throws:
MappingException
-
getPhysicalColumnName
public String getPhysicalColumnName(Table table, Identifier logicalName) throws MappingException
- Specified by:
getPhysicalColumnName
in interfaceInFlightMetadataCollector
- Throws:
MappingException
-
getLogicalColumnName
public String getLogicalColumnName(Table table, String physicalName) throws MappingException
- Specified by:
getLogicalColumnName
in interfaceInFlightMetadataCollector
- Throws:
MappingException
-
getLogicalColumnName
public String getLogicalColumnName(Table table, Identifier physicalName) throws MappingException
- Specified by:
getLogicalColumnName
in interfaceInFlightMetadataCollector
- Throws:
MappingException
-
addAuxiliaryDatabaseObject
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
Description copied from interface:InFlightMetadataCollector
Add metadata pertaining to an auxiliary database object to this repository.- Specified by:
addAuxiliaryDatabaseObject
in interfaceInFlightMetadataCollector
- Parameters:
auxiliaryDatabaseObject
- The metadata.
-
getClassType
public AnnotatedClassType getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
- Specified by:
getClassType
in interfaceInFlightMetadataCollector
-
addClassType
public AnnotatedClassType addClassType(org.hibernate.annotations.common.reflection.XClass clazz)
- Specified by:
addClassType
in interfaceInFlightMetadataCollector
-
addMappedSuperclass
public void addMappedSuperclass(Class type, MappedSuperclass mappedSuperclass)
- Specified by:
addMappedSuperclass
in interfaceInFlightMetadataCollector
-
getMappedSuperclass
public MappedSuperclass getMappedSuperclass(Class type)
- Specified by:
getMappedSuperclass
in interfaceInFlightMetadataCollector
-
getPropertyAnnotatedWithMapsId
public PropertyData getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, String propertyName)
- Specified by:
getPropertyAnnotatedWithMapsId
in interfaceInFlightMetadataCollector
-
addPropertyAnnotatedWithMapsId
public void addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
- Specified by:
addPropertyAnnotatedWithMapsId
in interfaceInFlightMetadataCollector
-
addPropertyAnnotatedWithMapsIdSpecj
public void addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property, String mapsIdValue)
- Specified by:
addPropertyAnnotatedWithMapsIdSpecj
in interfaceInFlightMetadataCollector
-
getPropertyAnnotatedWithIdAndToOne
public PropertyData getPropertyAnnotatedWithIdAndToOne(org.hibernate.annotations.common.reflection.XClass entityType, String propertyName)
- Specified by:
getPropertyAnnotatedWithIdAndToOne
in interfaceInFlightMetadataCollector
-
addToOneAndIdProperty
public void addToOneAndIdProperty(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
- Specified by:
addToOneAndIdProperty
in interfaceInFlightMetadataCollector
-
addMappedBy
public void addMappedBy(String entityName, String propertyName, String inversePropertyName)
- Specified by:
addMappedBy
in interfaceInFlightMetadataCollector
-
getFromMappedBy
public String getFromMappedBy(String entityName, String propertyName)
- Specified by:
getFromMappedBy
in interfaceInFlightMetadataCollector
-
addPropertyReferencedAssociation
public void addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)
- Specified by:
addPropertyReferencedAssociation
in interfaceInFlightMetadataCollector
-
getPropertyReferencedAssociation
public String getPropertyReferencedAssociation(String entityName, String propertyName)
- Specified by:
getPropertyReferencedAssociation
in interfaceInFlightMetadataCollector
-
addPropertyReference
public void addPropertyReference(String referencedClass, String propertyName)
- Specified by:
addPropertyReference
in interfaceInFlightMetadataCollector
-
addDelayedPropertyReferenceHandler
public void addDelayedPropertyReferenceHandler(InFlightMetadataCollector.DelayedPropertyReferenceHandler handler)
- Specified by:
addDelayedPropertyReferenceHandler
in interfaceInFlightMetadataCollector
-
addUniquePropertyReference
public void addUniquePropertyReference(String referencedClass, String propertyName)
- Specified by:
addUniquePropertyReference
in interfaceInFlightMetadataCollector
-
addUniqueConstraints
public void addUniqueConstraints(Table table, List uniqueConstraints)
- Specified by:
addUniqueConstraints
in interfaceInFlightMetadataCollector
-
addUniqueConstraintHolders
public void addUniqueConstraintHolders(Table table, List<UniqueConstraintHolder> uniqueConstraintHolders)
- Specified by:
addUniqueConstraintHolders
in interfaceInFlightMetadataCollector
-
addJpaIndexHolders
public void addJpaIndexHolders(Table table, List<JPAIndexHolder> holders)
- Specified by:
addJpaIndexHolders
in interfaceInFlightMetadataCollector
-
getEntityTableXref
public InFlightMetadataCollector.EntityTableXref getEntityTableXref(String entityName)
- Specified by:
getEntityTableXref
in interfaceInFlightMetadataCollector
-
addEntityTableXref
public InFlightMetadataCollector.EntityTableXref addEntityTableXref(String entityName, Identifier primaryTableLogicalName, Table primaryTable, InFlightMetadataCollector.EntityTableXref superEntityTableXref)
- Specified by:
addEntityTableXref
in interfaceInFlightMetadataCollector
-
getJoins
public Map<String,Join> getJoins(String entityName)
- Specified by:
getJoins
in interfaceInFlightMetadataCollector
-
addSecondPass
public void addSecondPass(SecondPass secondPass)
- Specified by:
addSecondPass
in interfaceInFlightMetadataCollector
-
addSecondPass
public void addSecondPass(SecondPass secondPass, boolean onTopOfTheQueue)
- Specified by:
addSecondPass
in interfaceInFlightMetadataCollector
-
processSecondPasses
public void processSecondPasses(MetadataBuildingContext buildingContext)
Ugh! But we need this done before we ask Envers to produce its entities.
-
secondPassCompileForeignKeys
protected void secondPassCompileForeignKeys(Table table, Set<ForeignKey> done, MetadataBuildingContext buildingContext) throws MappingException
- Throws:
MappingException
-
locateNaturalIdUniqueKeyBinder
public NaturalIdUniqueKeyBinder locateNaturalIdUniqueKeyBinder(String entityName)
- Specified by:
locateNaturalIdUniqueKeyBinder
in interfaceInFlightMetadataCollector
-
registerNaturalIdUniqueKeyBinder
public void registerNaturalIdUniqueKeyBinder(String entityName, NaturalIdUniqueKeyBinder ukBinder)
- Specified by:
registerNaturalIdUniqueKeyBinder
in interfaceInFlightMetadataCollector
-
isInSecondPass
public boolean isInSecondPass()
- Specified by:
isInSecondPass
in interfaceInFlightMetadataCollector
-
buildMetadataInstance
public MetadataImpl buildMetadataInstance(MetadataBuildingContext buildingContext)
Builds the complete and immutable Metadata instance from the collected info.- Returns:
- The complete and immutable Metadata instance
-
-