public class InFlightMetadataCollectorImpl extends Object implements InFlightMetadataCollector
The usage expectation is that this class is used until all Metadata info is
collected and then buildMetadataInstance(cn.sexycode.mybatis.jpa.binding.MetadataBuildingContext) is called to generate
the complete (and immutable) Metadata object.
InFlightMetadataCollector.DelayedPropertyReferenceHandler, InFlightMetadataCollector.DuplicateSecondaryTableException| 构造器和说明 |
|---|
InFlightMetadataCollectorImpl(MetadataBuildingOptions options,
cn.sexycode.sql.type.TypeResolver typeResolver) |
| 限定符和类型 | 方法和说明 |
|---|---|
AnnotatedClassType |
addClassType(cn.sexycode.util.core.cls.XClass clazz) |
void |
addColumnNameBinding(cn.sexycode.sql.mapping.Table table,
cn.sexycode.sql.model.Identifier logicalName,
cn.sexycode.sql.mapping.Column column) |
void |
addColumnNameBinding(cn.sexycode.sql.mapping.Table table,
String logicalName,
cn.sexycode.sql.mapping.Column column) |
void |
addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generator) |
void |
addEntityBinding(PersistentClass persistentClass)
Add the PersistentClass for an entity mapping.
|
void |
addIdentifierGenerator(IdentifierGeneratorDefinition generator) |
void |
addImport(String importName,
String entityName)
Adds an import (HQL entity rename).
|
void |
addMappedSuperclass(Class type,
javax.persistence.MappedSuperclass mappedSuperclass) |
cn.sexycode.sql.mapping.Table |
addTable(String schemaName,
String catalogName,
String name,
String subselectFragment,
boolean isAbstract)
Adds table metadata to this repository returning the created
metadata instance.
|
void |
addTableNameBinding(cn.sexycode.sql.model.Identifier logicalName,
cn.sexycode.sql.mapping.Table table) |
void |
addTableNameBinding(String schema,
String catalog,
String logicalName,
String realTableName,
cn.sexycode.sql.mapping.Table denormalizedSuperTable) |
void |
addUniqueConstraints(cn.sexycode.sql.mapping.Table table,
List uniqueConstraints) |
MetadataImpl |
buildMetadataInstance(MetadataBuildingContext buildingContext)
Builds the complete and immutable Metadata instance from the collected info.
|
SessionFactory |
buildSessionFactory() |
Collection<cn.sexycode.sql.mapping.Table> |
collectTableMappings() |
AnnotatedClassType |
getClassType(cn.sexycode.util.core.cls.XClass clazz) |
cn.sexycode.sql.model.Database |
getDatabase() |
PersistentClass |
getEntityBinding(String entityName)
Retrieves the PersistentClass entity mapping metadata representation for
the given entity name.
|
Map<String,PersistentClass> |
getEntityBindingMap()
Needed for SecondPass handling
|
Collection<PersistentClass> |
getEntityBindings()
Retrieves the PersistentClass entity metadata representation for known all entities.
|
IdentifierGeneratorDefinition |
getIdentifierGenerator(String name) |
Map<String,String> |
getImports() |
String |
getLogicalColumnName(cn.sexycode.sql.mapping.Table table,
cn.sexycode.sql.model.Identifier physicalName) |
String |
getLogicalColumnName(cn.sexycode.sql.mapping.Table table,
String physicalName) |
String |
getLogicalTableName(cn.sexycode.sql.mapping.Table ownerTable) |
javax.persistence.MappedSuperclass |
getMappedSuperclass(Class type) |
Set<javax.persistence.MappedSuperclass> |
getMappedSuperclassMappingsCopy() |
MetadataBuildingOptions |
getMetadataBuildingOptions() |
String |
getPhysicalColumnName(cn.sexycode.sql.mapping.Table table,
cn.sexycode.sql.model.Identifier logicalName) |
String |
getPhysicalColumnName(cn.sexycode.sql.mapping.Table table,
String logicalName) |
String |
getPhysicalTableName(cn.sexycode.sql.model.Identifier logicalName) |
String |
getPhysicalTableName(String logicalName) |
SessionFactoryBuilder |
getSessionFactoryBuilder() |
Map<String,cn.sexycode.sql.dialect.function.SQLFunction> |
getSqlFunctionMap() |
cn.sexycode.sql.type.TypeResolver |
getTypeResolver() |
UUID |
getUUID() |
boolean |
isInSecondPass() |
void |
validate() |
public InFlightMetadataCollectorImpl(MetadataBuildingOptions options, cn.sexycode.sql.type.TypeResolver typeResolver)
public UUID getUUID()
getUUID 在接口中 InFlightMetadataCollectorpublic MetadataBuildingOptions getMetadataBuildingOptions()
public cn.sexycode.sql.type.TypeResolver getTypeResolver()
getTypeResolver 在接口中 InFlightMetadataCollectorpublic cn.sexycode.sql.model.Database getDatabase()
getDatabase 在接口中 InFlightMetadataCollectorpublic Map<String,cn.sexycode.sql.dialect.function.SQLFunction> getSqlFunctionMap()
getSqlFunctionMap 在接口中 InFlightMetadataCollectorpublic void validate()
throws MappingException
validate 在接口中 InFlightMetadataCollectorMappingExceptionpublic Set<javax.persistence.MappedSuperclass> getMappedSuperclassMappingsCopy()
public SessionFactoryBuilder getSessionFactoryBuilder()
public SessionFactory buildSessionFactory()
buildSessionFactory 在接口中 InFlightMetadataCollectorpublic Collection<PersistentClass> getEntityBindings()
MetadataReturned collection is immutable
getEntityBindings 在接口中 Metadatapublic Map<String,PersistentClass> getEntityBindingMap()
InFlightMetadataCollectorgetEntityBindingMap 在接口中 InFlightMetadataCollectorpublic PersistentClass getEntityBinding(String entityName)
MetadatagetEntityBinding 在接口中 MetadataentityName - The entity name for which to retrieve the metadata.null if no matching entity found.public void addEntityBinding(PersistentClass persistentClass) throws DuplicateMappingException
InFlightMetadataCollectoraddEntityBinding 在接口中 InFlightMetadataCollectorpersistentClass - The entity metadataDuplicateMappingException - Indicates there was already an entry
corresponding to the given entity name.public IdentifierGeneratorDefinition getIdentifierGenerator(String name)
public Collection<cn.sexycode.sql.mapping.Table> collectTableMappings()
public void addIdentifierGenerator(IdentifierGeneratorDefinition generator)
public void addDefaultIdentifierGenerator(IdentifierGeneratorDefinition generator)
public Map<String,String> getImports()
getImports 在接口中 InFlightMetadataCollectorpublic void addImport(String importName, String entityName)
InFlightMetadataCollectoraddImport 在接口中 InFlightMetadataCollectorimportName - The entity name being renamed.entityName - The renamepublic cn.sexycode.sql.mapping.Table addTable(String schemaName, String catalogName, String name, String subselectFragment, boolean isAbstract)
InFlightMetadataCollectoraddTable 在接口中 InFlightMetadataCollectorschemaName - 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 void addTableNameBinding(cn.sexycode.sql.model.Identifier logicalName,
cn.sexycode.sql.mapping.Table table)
addTableNameBinding 在接口中 InFlightMetadataCollectorpublic void addTableNameBinding(String schema, String catalog, String logicalName, String realTableName, cn.sexycode.sql.mapping.Table denormalizedSuperTable)
addTableNameBinding 在接口中 InFlightMetadataCollectorpublic String getLogicalTableName(cn.sexycode.sql.mapping.Table ownerTable)
getLogicalTableName 在接口中 InFlightMetadataCollectorpublic String getPhysicalTableName(cn.sexycode.sql.model.Identifier logicalName)
public void addColumnNameBinding(cn.sexycode.sql.mapping.Table table,
String logicalName,
cn.sexycode.sql.mapping.Column column)
throws DuplicateMappingException
public void addColumnNameBinding(cn.sexycode.sql.mapping.Table table,
cn.sexycode.sql.model.Identifier logicalName,
cn.sexycode.sql.mapping.Column column)
throws DuplicateMappingException
public String getPhysicalColumnName(cn.sexycode.sql.mapping.Table table, String logicalName) throws MappingException
getPhysicalColumnName 在接口中 InFlightMetadataCollectorMappingExceptionpublic String getPhysicalColumnName(cn.sexycode.sql.mapping.Table table, cn.sexycode.sql.model.Identifier logicalName) throws MappingException
getPhysicalColumnName 在接口中 InFlightMetadataCollectorMappingExceptionpublic String getLogicalColumnName(cn.sexycode.sql.mapping.Table table, String physicalName) throws MappingException
getLogicalColumnName 在接口中 InFlightMetadataCollectorMappingExceptionpublic String getLogicalColumnName(cn.sexycode.sql.mapping.Table table, cn.sexycode.sql.model.Identifier physicalName) throws MappingException
getLogicalColumnName 在接口中 InFlightMetadataCollectorMappingExceptionpublic void addMappedSuperclass(Class type, javax.persistence.MappedSuperclass mappedSuperclass)
addMappedSuperclass 在接口中 InFlightMetadataCollectorpublic javax.persistence.MappedSuperclass getMappedSuperclass(Class type)
getMappedSuperclass 在接口中 InFlightMetadataCollectorpublic boolean isInSecondPass()
isInSecondPass 在接口中 InFlightMetadataCollectorpublic void addUniqueConstraints(cn.sexycode.sql.mapping.Table table,
List uniqueConstraints)
public MetadataImpl buildMetadataInstance(MetadataBuildingContext buildingContext)
public AnnotatedClassType getClassType(cn.sexycode.util.core.cls.XClass clazz)
getClassType 在接口中 InFlightMetadataCollectorpublic AnnotatedClassType addClassType(cn.sexycode.util.core.cls.XClass clazz)
addClassType 在接口中 InFlightMetadataCollectorCopyright © 2019. All rights reserved.