public class InFlightMetadataCollectorImpl extends Object implements InFlightMetadataCollector
buildMetadataInstance(org.hibernate.boot.spi.MetadataBuildingContext)
is called to generate
the complete (and immutable) Metadata object.InFlightMetadataCollector.DelayedPropertyReferenceHandler, InFlightMetadataCollector.DuplicateSecondaryTableException, InFlightMetadataCollector.EntityTableXref
Constructor and Description |
---|
InFlightMetadataCollectorImpl(MetadataBuildingOptions options,
TypeResolver typeResolver) |
public InFlightMetadataCollectorImpl(MetadataBuildingOptions options, TypeResolver typeResolver)
public UUID getUUID()
Metadata
UUID
for this metamodel.public MetadataBuildingOptions getMetadataBuildingOptions()
MetadataImplementor
getMetadataBuildingOptions
in interface MetadataImplementor
public TypeResolver getTypeResolver()
getTypeResolver
in interface InFlightMetadataCollector
getTypeResolver
in interface MetadataImplementor
public Database getDatabase()
Metadata
getDatabase
in interface Metadata
getDatabase
in interface InFlightMetadataCollector
public NamedQueryRepository buildNamedQueryRepository(SessionFactoryImpl sessionFactory)
buildNamedQueryRepository
in interface MetadataImplementor
public Map<String,SQLFunction> getSqlFunctionMap()
getSqlFunctionMap
in interface Metadata
public void validate() throws MappingException
validate
in interface MetadataImplementor
MappingException
public Set<MappedSuperclass> getMappedSuperclassMappingsCopy()
getMappedSuperclassMappingsCopy
in interface MetadataImplementor
public IdentifierGeneratorFactory getIdentifierGeneratorFactory()
Mapping
getIdentifierGeneratorFactory
in interface Mapping
public SessionFactoryBuilder getSessionFactoryBuilder()
Metadata
SessionFactory
instances based on this metamodel,getSessionFactoryBuilder
in interface Metadata
SessionFactory
instances.public SessionFactory buildSessionFactory()
Metadata
SessionFactory
through the builder without any additional
option overrides.buildSessionFactory
in interface Metadata
public Collection<PersistentClass> getEntityBindings()
Metadata
getEntityBindings
in interface Metadata
public Map<String,PersistentClass> getEntityBindingMap()
InFlightMetadataCollector
getEntityBindingMap
in interface InFlightMetadataCollector
public PersistentClass getEntityBinding(String entityName)
Metadata
getEntityBinding
in interface Metadata
entityName
- The entity name for which to retrieve the metadata.null
if no matching entity found.public void addEntityBinding(PersistentClass persistentClass) throws DuplicateMappingException
InFlightMetadataCollector
addEntityBinding
in interface InFlightMetadataCollector
persistentClass
- The entity metadataDuplicateMappingException
- Indicates there was already an entry
corresponding to the given entity name.public Collection<Collection> getCollectionBindings()
Metadata
getCollectionBindings
in interface Metadata
public Collection getCollectionBinding(String role)
Metadata
getCollectionBinding
in interface Metadata
role
- The collection role for which to retrieve the metadata.null
if no matching collection found.public void addCollectionBinding(Collection collection) throws DuplicateMappingException
InFlightMetadataCollector
addCollectionBinding
in interface InFlightMetadataCollector
collection
- The collection metadataDuplicateMappingException
- Indicates there was already an entry
corresponding to the given collection rolepublic TypeDefinition getTypeDefinition(String registrationKey)
Metadata
getTypeDefinition
in interface Metadata
registrationKey
- The name of the type definition to retrieve.null
public void addTypeDefinition(TypeDefinition typeDefinition)
InFlightMetadataCollector
addTypeDefinition
in interface InFlightMetadataCollector
typeDefinition
- The named type definition to add.public ClassmateContext getClassmateContext()
getClassmateContext
in interface InFlightMetadataCollector
public void addAttributeConverter(AttributeConverterDefinition definition)
addAttributeConverter
in interface InFlightMetadataCollector
public void addAttributeConverter(Class<? extends AttributeConverter> converterClass)
addAttributeConverter
in interface InFlightMetadataCollector
public AttributeConverterAutoApplyHandler getAttributeConverterAutoApplyHandler()
getAttributeConverterAutoApplyHandler
in interface InFlightMetadataCollector
public Map<String,FilterDefinition> getFilterDefinitions()
Metadata
getFilterDefinitions
in interface Metadata
public FilterDefinition getFilterDefinition(String name)
Metadata
getFilterDefinition
in interface Metadata
name
- The name of the filter definition to retrieve
.null
.public void addFilterDefinition(FilterDefinition filterDefinition)
InFlightMetadataCollector
addFilterDefinition
in interface InFlightMetadataCollector
filterDefinition
- The filter definition to add.public Collection<FetchProfile> getFetchProfiles()
getFetchProfiles
in interface Metadata
public FetchProfile getFetchProfile(String name)
getFetchProfile
in interface Metadata
public void addFetchProfile(FetchProfile profile)
addFetchProfile
in interface InFlightMetadataCollector
public IdentifierGeneratorDefinition getIdentifierGenerator(String name)
getIdentifierGenerator
in interface Metadata
public Collection<Table> collectTableMappings()
collectTableMappings
in interface Metadata
public void addIdentifierGenerator(IdentifierGeneratorDefinition generator)
addIdentifierGenerator
in interface InFlightMetadataCollector
public void addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generator)
addDefaultIdentifierGenerator
in interface InFlightMetadataCollector
public NamedEntityGraphDefinition getNamedEntityGraph(String name)
getNamedEntityGraph
in interface Metadata
public Map<String,NamedEntityGraphDefinition> getNamedEntityGraphs()
getNamedEntityGraphs
in interface Metadata
public void addNamedEntityGraph(NamedEntityGraphDefinition definition)
InFlightMetadataCollector
addNamedEntityGraph
in interface InFlightMetadataCollector
definition
- The procedure call informationpublic NamedQueryDefinition getNamedQueryDefinition(String name)
Metadata
getNamedQueryDefinition
in interface Metadata
name
- The query namenull
.public Collection<NamedQueryDefinition> getNamedQueryDefinitions()
getNamedQueryDefinitions
in interface Metadata
public void addNamedQuery(NamedQueryDefinition def)
InFlightMetadataCollector
addNamedQuery
in interface InFlightMetadataCollector
def
- The metadatapublic void addDefaultQuery(NamedQueryDefinition queryDefinition)
addDefaultQuery
in interface InFlightMetadataCollector
public NamedSQLQueryDefinition getNamedNativeQueryDefinition(String name)
Metadata
getNamedNativeQueryDefinition
in interface Metadata
name
- The SQL query name.null
public Collection<NamedSQLQueryDefinition> getNamedNativeQueryDefinitions()
getNamedNativeQueryDefinitions
in interface Metadata
public void addNamedNativeQuery(NamedSQLQueryDefinition def)
InFlightMetadataCollector
addNamedNativeQuery
in interface InFlightMetadataCollector
def
- The metadatapublic void addDefaultNamedNativeQuery(NamedSQLQueryDefinition query)
addDefaultNamedNativeQuery
in interface InFlightMetadataCollector
public Collection<NamedProcedureCallDefinition> getNamedProcedureCallDefinitions()
getNamedProcedureCallDefinitions
in interface Metadata
public void addNamedProcedureCallDefinition(NamedProcedureCallDefinition definition)
InFlightMetadataCollector
addNamedProcedureCallDefinition
in interface InFlightMetadataCollector
definition
- The procedure call informationpublic void addDefaultNamedProcedureCallDefinition(NamedProcedureCallDefinition definition)
addDefaultNamedProcedureCallDefinition
in interface InFlightMetadataCollector
public Map<String,ResultSetMappingDefinition> getResultSetMappingDefinitions()
getResultSetMappingDefinitions
in interface Metadata
public ResultSetMappingDefinition getResultSetMapping(String name)
Metadata
getResultSetMapping
in interface Metadata
name
- The mapping name.null
if none found.public void addResultSetMapping(ResultSetMappingDefinition resultSetMappingDefinition)
InFlightMetadataCollector
addResultSetMapping
in interface InFlightMetadataCollector
resultSetMappingDefinition
- The metadatapublic void applyResultSetMapping(ResultSetMappingDefinition resultSetMappingDefinition)
public void addDefaultResultSetMapping(ResultSetMappingDefinition definition)
addDefaultResultSetMapping
in interface InFlightMetadataCollector
public Map<String,String> getImports()
Metadata
getImports
in interface Metadata
public void addImport(String importName, String entityName)
InFlightMetadataCollector
addImport
in interface InFlightMetadataCollector
importName
- The entity name being renamed.entityName
- The renamepublic Table addTable(String schemaName, String catalogName, String name, String subselectFragment, boolean isAbstract)
InFlightMetadataCollector
addTable
in interface InFlightMetadataCollector
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)?public Table addDenormalizedTable(String schemaName, String catalogName, String name, boolean isAbstract, String subselectFragment, Table includedTable) throws DuplicateMappingException
InFlightMetadataCollector
addDenormalizedTable
in interface InFlightMetadataCollector
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
- ???DuplicateMappingException
- If such a table mapping already exists.public Type getIdentifierType(String entityName) throws MappingException
getIdentifierType
in interface Mapping
MappingException
public String getIdentifierPropertyName(String entityName) throws MappingException
getIdentifierPropertyName
in interface Mapping
MappingException
public Type getReferencedPropertyType(String entityName, String propertyName) throws MappingException
getReferencedPropertyType
in interface Mapping
MappingException
public void addTableNameBinding(Identifier logicalName, Table table)
addTableNameBinding
in interface InFlightMetadataCollector
public void addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, Table denormalizedSuperTable)
addTableNameBinding
in interface InFlightMetadataCollector
public String getLogicalTableName(Table ownerTable)
getLogicalTableName
in interface InFlightMetadataCollector
public String getPhysicalTableName(Identifier logicalName)
getPhysicalTableName
in interface InFlightMetadataCollector
public String getPhysicalTableName(String logicalName)
getPhysicalTableName
in interface InFlightMetadataCollector
public void addColumnNameBinding(Table table, String logicalName, Column column) throws DuplicateMappingException
addColumnNameBinding
in interface InFlightMetadataCollector
DuplicateMappingException
public void addColumnNameBinding(Table table, Identifier logicalName, Column column) throws DuplicateMappingException
addColumnNameBinding
in interface InFlightMetadataCollector
DuplicateMappingException
public String getPhysicalColumnName(Table table, String logicalName) throws MappingException
getPhysicalColumnName
in interface InFlightMetadataCollector
MappingException
public String getPhysicalColumnName(Table table, Identifier logicalName) throws MappingException
getPhysicalColumnName
in interface InFlightMetadataCollector
MappingException
public String getLogicalColumnName(Table table, String physicalName) throws MappingException
getLogicalColumnName
in interface InFlightMetadataCollector
MappingException
public String getLogicalColumnName(Table table, Identifier physicalName) throws MappingException
getLogicalColumnName
in interface InFlightMetadataCollector
MappingException
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject)
InFlightMetadataCollector
addAuxiliaryDatabaseObject
in interface InFlightMetadataCollector
auxiliaryDatabaseObject
- The metadata.public AnnotatedClassType getClassType(XClass clazz)
getClassType
in interface InFlightMetadataCollector
public AnnotatedClassType addClassType(XClass clazz)
addClassType
in interface InFlightMetadataCollector
public void addAnyMetaDef(AnyMetaDef defAnn)
addAnyMetaDef
in interface InFlightMetadataCollector
public AnyMetaDef getAnyMetaDef(String name)
getAnyMetaDef
in interface InFlightMetadataCollector
public void addMappedSuperclass(Class type, MappedSuperclass mappedSuperclass)
addMappedSuperclass
in interface InFlightMetadataCollector
public MappedSuperclass getMappedSuperclass(Class type)
getMappedSuperclass
in interface InFlightMetadataCollector
public PropertyData getPropertyAnnotatedWithMapsId(XClass entityType, String propertyName)
getPropertyAnnotatedWithMapsId
in interface InFlightMetadataCollector
public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property)
addPropertyAnnotatedWithMapsId
in interface InFlightMetadataCollector
public void addPropertyAnnotatedWithMapsIdSpecj(XClass entityType, PropertyData property, String mapsIdValue)
addPropertyAnnotatedWithMapsIdSpecj
in interface InFlightMetadataCollector
public PropertyData getPropertyAnnotatedWithIdAndToOne(XClass entityType, String propertyName)
getPropertyAnnotatedWithIdAndToOne
in interface InFlightMetadataCollector
public void addToOneAndIdProperty(XClass entityType, PropertyData property)
addToOneAndIdProperty
in interface InFlightMetadataCollector
public void addMappedBy(String entityName, String propertyName, String inversePropertyName)
addMappedBy
in interface InFlightMetadataCollector
public String getFromMappedBy(String entityName, String propertyName)
getFromMappedBy
in interface InFlightMetadataCollector
public void addPropertyReferencedAssociation(String entityName, String propertyName, String propertyRef)
addPropertyReferencedAssociation
in interface InFlightMetadataCollector
public String getPropertyReferencedAssociation(String entityName, String propertyName)
getPropertyReferencedAssociation
in interface InFlightMetadataCollector
public void addPropertyReference(String referencedClass, String propertyName)
addPropertyReference
in interface InFlightMetadataCollector
public void addDelayedPropertyReferenceHandler(InFlightMetadataCollector.DelayedPropertyReferenceHandler handler)
addDelayedPropertyReferenceHandler
in interface InFlightMetadataCollector
public void addUniquePropertyReference(String referencedClass, String propertyName)
addUniquePropertyReference
in interface InFlightMetadataCollector
public void addUniqueConstraints(Table table, List uniqueConstraints)
addUniqueConstraints
in interface InFlightMetadataCollector
public void addUniqueConstraintHolders(Table table, List<UniqueConstraintHolder> uniqueConstraintHolders)
addUniqueConstraintHolders
in interface InFlightMetadataCollector
public void addJpaIndexHolders(Table table, List<JPAIndexHolder> holders)
addJpaIndexHolders
in interface InFlightMetadataCollector
public InFlightMetadataCollector.EntityTableXref getEntityTableXref(String entityName)
getEntityTableXref
in interface InFlightMetadataCollector
public InFlightMetadataCollector.EntityTableXref addEntityTableXref(String entityName, Identifier primaryTableLogicalName, Table primaryTable, InFlightMetadataCollector.EntityTableXref superEntityTableXref)
addEntityTableXref
in interface InFlightMetadataCollector
public Map<String,Join> getJoins(String entityName)
getJoins
in interface InFlightMetadataCollector
public void addSecondPass(SecondPass secondPass)
addSecondPass
in interface InFlightMetadataCollector
public void addSecondPass(SecondPass secondPass, boolean onTopOfTheQueue)
addSecondPass
in interface InFlightMetadataCollector
public void processSecondPasses(MetadataBuildingContext buildingContext)
protected void secondPassCompileForeignKeys(Table table, Set<ForeignKey> done, MetadataBuildingContext buildingContext) throws MappingException
MappingException
public NaturalIdUniqueKeyBinder locateNaturalIdUniqueKeyBinder(String entityName)
locateNaturalIdUniqueKeyBinder
in interface InFlightMetadataCollector
public void registerNaturalIdUniqueKeyBinder(String entityName, NaturalIdUniqueKeyBinder ukBinder)
registerNaturalIdUniqueKeyBinder
in interface InFlightMetadataCollector
public boolean isInSecondPass()
isInSecondPass
in interface InFlightMetadataCollector
public MetadataImpl buildMetadataInstance(MetadataBuildingContext buildingContext)
Copyright © 2017 JBoss by Red Hat. All rights reserved.