Package org.hibernate.boot.internal
Class InFlightMetadataCollectorImpl
- java.lang.Object
-
- org.hibernate.boot.internal.InFlightMetadataCollectorImpl
-
- All Implemented Interfaces:
Metadata
,InFlightMetadataCollector
,MetadataImplementor
,Mapping
public class InFlightMetadataCollectorImpl extends Object implements InFlightMetadataCollector
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttributeConverter(Class<? extends jakarta.persistence.AttributeConverter<?,?>> converterClass)
Apply anAttributeConverter
void
addAttributeConverter(ConverterDescriptor descriptor)
Apply the descriptor for anAttributeConverter
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 logicalName, Column column)
void
addColumnNameBinding(Table table, Identifier logicalName, Column column)
void
addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generator)
void
addDefaultNamedNativeQuery(NamedNativeQueryDefinition query)
void
addDefaultNamedProcedureCall(NamedProcedureCallDefinitionImpl definition)
void
addDefaultQuery(NamedHqlQueryDefinition queryDefinition)
void
addDefaultResultSetMapping(NamedResultSetMappingDescriptor definition)
void
addDelayedPropertyReferenceHandler(InFlightMetadataCollector.DelayedPropertyReferenceHandler handler)
Table
addDenormalizedTable(String schemaName, String catalogName, String name, boolean isAbstract, String subselectFragment, Table includedTable, MetadataBuildingContext buildingContext)
Adds a 'denormalized table' to this repository.void
addEntityBinding(PersistentClass persistentClass)
Add the PersistentClass for an entity mapping.InFlightMetadataCollector.EntityTableXref
addEntityTableXref(String entityName, Identifier primaryTableLogicalName, Table primaryTable, InFlightMetadataCollector.EntityTableXref superEntityTableXref)
void
addFetchProfile(FetchProfile profile)
void
addFilterDefinition(FilterDefinition filterDefinition)
Adds a filter definition to this repository.void
addIdentifierGenerator(IdentifierGeneratorDefinition generator)
void
addImport(String importName, String entityName)
Adds an import (HQL entity rename).void
addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd)
void
addJdbcTypeRegistration(int typeCode, JdbcType jdbcType)
void
addJpaIndexHolders(Table table, List<JPAIndexHolder> holders)
void
addMappedBy(String entityName, String propertyName, String inversePropertyName)
void
addMappedSuperclass(Class type, MappedSuperclass mappedSuperclass)
void
addNamedEntityGraph(NamedEntityGraphDefinition definition)
Adds metadata for a named entity graph to this repositoryvoid
addNamedNativeQuery(NamedNativeQueryDefinition def)
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 def)
Adds metadata for a named query to this repository.void
addPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property)
void
addPropertyAnnotatedWithMapsIdSpecj(org.hibernate.annotations.common.reflection.XClass entityType, PropertyData property, String mapsIdValue)
void
addPropertyReference(String referencedClass, String propertyName)
void
addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)
void
addRegisteredConversion(RegisteredConversion conversion)
void
addResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDescriptor)
Adds the metadata for a named SQL result set mapping to this collector.void
addSecondPass(SecondPass secondPass)
void
addSecondPass(SecondPass secondPass, boolean onTopOfTheQueue)
Table
addTable(String schemaName, String catalogName, String name, String subselectFragment, 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 entityType, PropertyData property)
void
addTypeDefinition(TypeDefinition typeDefinition)
Adds a type definition to this metadata repository.void
addUniqueConstraintHolders(Table table, List<UniqueConstraintHolder> uniqueConstraintHolders)
void
addUniqueConstraints(Table table, List uniqueConstraints)
void
addUniquePropertyReference(String referencedClass, String propertyName)
void
applyResultSetMapping(NamedResultSetMappingDescriptor resultSetMappingDescriptor)
MetadataImpl
buildMetadataInstance(MetadataBuildingContext buildingContext)
Builds the complete and immutable Metadata instance from the collected info.NamedObjectRepository
buildNamedQueryRepository(SessionFactoryImplementor sessionFactory)
SessionFactory
buildSessionFactory()
Short-hand form of building aSessionFactory
through the builder without any additional option overrides.Collection<Table>
collectTableMappings()
InFlightMetadataCollector.CollectionTypeRegistrationDescriptor
findCollectionTypeRegistration(CollectionClassification classification)
Class<? extends CompositeUserType<?>>
findRegisteredCompositeUserType(Class<?> embeddableType)
Class<? extends EmbeddableInstantiator>
findRegisteredEmbeddableInstantiator(Class<?> embeddableType)
ConverterAutoApplyHandler
getAttributeConverterAutoApplyHandler()
BootstrapContext
getBootstrapContext()
AnnotatedClassType
getClassType(org.hibernate.annotations.common.reflection.XClass clazz)
Collection
getCollectionBinding(String role)
Retrieves the collection mapping metadata for the given collection role.Collection<Collection>
getCollectionBindings()
Retrieves the Collection metadata representation for all known collections.Set<String>
getContributors()
All of the known model contributorsDatabase
getDatabase()
Retrieve the database model.PersistentClass
getEntityBinding(String entityName)
Retrieves the PersistentClass entity mapping metadata representation for the given entity name.Map<String,PersistentClass>
getEntityBindingMap()
Needed for SecondPass handlingCollection<PersistentClass>
getEntityBindings()
Retrieves the PersistentClass entity metadata representation for all known entities.InFlightMetadataCollector.EntityTableXref
getEntityTableXref(String entityName)
FetchProfile
getFetchProfile(String name)
Collection<FetchProfile>
getFetchProfiles()
FilterDefinition
getFilterDefinition(String name)
Retrieves a filter definition by name.Map<String,FilterDefinition>
getFilterDefinitions()
Retrieves the complete map of filter definitions.String
getFromMappedBy(String entityName, String propertyName)
IdentifierGeneratorDefinition
getIdentifierGenerator(String name)
String
getIdentifierPropertyName(String entityName)
Type
getIdentifierType(String entityName)
Map<String,String>
getImports()
Retrieves all defined imports (class renames).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)
Set<MappedSuperclass>
getMappedSuperclassMappingsCopy()
MetadataBuildingOptions
getMetadataBuildingOptions()
Access to the options used to build this MetadataNamedEntityGraphDefinition
getNamedEntityGraph(String name)
Map<String,NamedEntityGraphDefinition>
getNamedEntityGraphs()
NamedHqlQueryDefinition
getNamedHqlQueryMapping(String name)
Retrieve named query metadata by name.NamedNativeQueryDefinition
getNamedNativeQueryMapping(String name)
Retrieve named SQL query metadata.NamedProcedureCallDefinition
getNamedProcedureCallMapping(String name)
Retrieve named procedure metadata.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 entityType, String propertyName)
PropertyData
getPropertyAnnotatedWithMapsId(org.hibernate.annotations.common.reflection.XClass entityType, String propertyName)
String
getPropertyReferencedAssociation(String entityName, String propertyName)
Type
getReferencedPropertyType(String entityName, String propertyName)
NamedResultSetMappingDescriptor
getResultSetMapping(String name)
Retrieve the metadata for a named SQL result set mapping.SessionFactoryBuilder
getSessionFactoryBuilder()
Get the builder forSessionFactory
instances based on this metamodel.Map<String,SqmFunctionDescriptor>
getSqlFunctionMap()
TypeConfiguration
getTypeConfiguration()
Access to the TypeConfigurationTypeDefinition
getTypeDefinition(String registrationKey)
Retrieve a type definition by name.TypeDefinitionRegistry
getTypeDefinitionRegistry()
UUID
getUUID()
Gets theUUID
for this metamodel.void
initSessionFactory(SessionFactoryImplementor sessionFactory)
boolean
isInSecondPass()
NaturalIdUniqueKeyBinder
locateNaturalIdUniqueKeyBinder(String entityName)
void
processSecondPasses(MetadataBuildingContext buildingContext)
Ugh! But we need this done before we ask Envers to produce its entities.void
registerComponent(Component component)
void
registerCompositeUserType(Class<?> embeddableType, Class<? extends CompositeUserType<?>> userType)
void
registerEmbeddableInstantiator(Class<?> embeddableType, Class<? extends EmbeddableInstantiator> instantiator)
void
registerNaturalIdUniqueKeyBinder(String entityName, NaturalIdUniqueKeyBinder ukBinder)
void
registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver)
protected void
secondPassCompileForeignKeys(Table table, Set<ForeignKey> done, MetadataBuildingContext buildingContext)
void
validate()
void
visitNamedHqlQueryDefinitions(Consumer<NamedHqlQueryDefinition> definitionConsumer)
Visit all named HQL query definitionsvoid
visitNamedNativeQueryDefinitions(Consumer<NamedNativeQueryDefinition> definitionConsumer)
Visit all named native query definitionsvoid
visitNamedProcedureCallDefinition(Consumer<NamedProcedureCallDefinition> definitionConsumer)
Visit all named callable query definitionsvoid
visitNamedResultSetMappingDefinition(Consumer<NamedResultSetMappingDescriptor> definitionConsumer)
Visit all named SQL result set mapping definitionsvoid
visitRegisteredComponents(Consumer<Component> consumer)
-
-
-
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 this Metadata- Specified by:
getMetadataBuildingOptions
in interfaceMetadataImplementor
- Returns:
- Access to the MetadataBuildingOptions
-
getBootstrapContext
public BootstrapContext getBootstrapContext()
- Specified by:
getBootstrapContext
in interfaceInFlightMetadataCollector
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:MetadataImplementor
Access to the TypeConfiguration- Specified by:
getTypeConfiguration
in interfaceMetadataImplementor
- Returns:
- Access to the TypeConfiguration
-
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
-
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
-
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()
- 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
-
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
-
addAttributeConverter
public void addAttributeConverter(Class<? extends jakarta.persistence.AttributeConverter<?,?>> converterClass)
Description copied from interface:InFlightMetadataCollector
Apply anAttributeConverter
- Specified by:
addAttributeConverter
in interfaceInFlightMetadataCollector
-
addAttributeConverter
public void addAttributeConverter(ConverterDescriptor descriptor)
Description copied from interface:InFlightMetadataCollector
Apply the descriptor for anAttributeConverter
- Specified by:
addAttributeConverter
in interfaceInFlightMetadataCollector
-
addRegisteredConversion
public void addRegisteredConversion(RegisteredConversion conversion)
- Specified by:
addRegisteredConversion
in interfaceInFlightMetadataCollector
-
getAttributeConverterAutoApplyHandler
public ConverterAutoApplyHandler getAttributeConverterAutoApplyHandler()
- 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)
- 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 entityName)
Description copied from interface:InFlightMetadataCollector
Adds an import (HQL entity rename).- Specified by:
addImport
in interfaceInFlightMetadataCollector
- Parameters:
importName
- The entity name being renamed.entityName
- The rename
-
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
-
-