public class SchemaConfiguration extends AbstractSchemaConfiguration implements Configuration
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
log
The log.
|
private Map<String,List<TableInfo>> |
puToSchemaMetadata
pu to schema metadata map .
|
externalPropertyMap, kunderaMetadata, persistenceUnits| Constructor and Description |
|---|
SchemaConfiguration(Map externalProperties,
EntityManagerFactoryImpl.KunderaMetadata metadata,
String... persistenceUnits)
Constructor using persistence units as parameter.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addColumnToTableInfo(EntityMetadata entityMetadata,
EntityMetadata.Type type,
TableInfo tableInfo)
Adds column to table info of entity.
|
private void |
addJoinColumnToInfo(String joinColumn,
TableInfo targetTableInfo,
List<TableInfo> targetTableInfos,
EntityMetadata m)
adds join column name to the table Info of entity.
|
private void |
addTableGenerator(ApplicationMetadata appMetadata,
String persistenceUnit,
List<TableInfo> tableInfos,
EntityMetadata entityMetadata)
Add tableGenerator to table info.
|
void |
configure()
Configures and load meta-information for parameterized persistence units.
|
private ColumnInfo |
getColumn(TableInfo tableInfo,
javax.persistence.metamodel.Attribute column,
PropertyIndex indexedColumn,
String[] orderByColumns)
getColumn method return ColumnInfo for the given column
|
private EmbeddedColumnInfo |
getEmbeddedColumn(TableInfo tableInfo,
javax.persistence.metamodel.EmbeddableType embeddableType,
String embeddableColName,
Class embeddedEntityClass,
Field field)
Get Embedded column info.
|
private Map<String,EntityMetadata> |
getEntityMetadataCol(ApplicationMetadata appMetadata,
String persistenceUnit)
Returns map of entity metdata
EntityMetadata. |
private ColumnInfo |
getJoinColumn(TableInfo tableInfo,
String joinColumnName,
Class columnType)
getJoinColumn method return ColumnInfo for the join column
|
private String |
getOrderByColumn(String[] orderByColumns,
javax.persistence.metamodel.Attribute column)
getOrderByColumn method return order by value of the column
|
private List<TableInfo> |
getSchemaInfo(String persistenceUnit)
Returns list of configured table/column families.
|
private SchemaManager |
getSchemaManagerForPu(String persistenceUnit)
Return schema manager for pu.
|
private String |
getSchemaProperty(String persistenceUnit,
Map<String,Object> externalProperties)
getKunderaProperty method return auto schema generation property for give
persistence unit.
|
private void |
onInheritedProperty(TableInfo tableInfo,
javax.persistence.metamodel.EntityType entityType)
Add
DiscriminatorColumn for schema generation. |
private void |
parseRelations(String persistenceUnit,
List<TableInfo> tableInfos,
EntityMetadata entityMetadata,
TableInfo tableInfo,
List<Relation> relations)
parse the relations of entites .
|
public SchemaConfiguration(Map externalProperties, EntityManagerFactoryImpl.KunderaMetadata metadata, String... persistenceUnits)
persistenceUnits - persistence units.public void configure()
Configurationconfigure in interface Configurationprivate SchemaManager getSchemaManagerForPu(String persistenceUnit)
persistenceUnit - private void addTableGenerator(ApplicationMetadata appMetadata, String persistenceUnit, List<TableInfo> tableInfos, EntityMetadata entityMetadata)
appMetadata - persistenceUnit - tableInfos - entityMetadata - isCompositeId - private void parseRelations(String persistenceUnit, List<TableInfo> tableInfos, EntityMetadata entityMetadata, TableInfo tableInfo, List<Relation> relations)
persistenceUnit - tableInfos - entityMetadata - tableInfo - relations - private void addJoinColumnToInfo(String joinColumn, TableInfo targetTableInfo, List<TableInfo> targetTableInfos, EntityMetadata m)
joinColumn - targetTableInfo - targetTableInfos - private void addColumnToTableInfo(EntityMetadata entityMetadata, EntityMetadata.Type type, TableInfo tableInfo)
entityMetadata - type - tableInfo - private void onInheritedProperty(TableInfo tableInfo, javax.persistence.metamodel.EntityType entityType)
DiscriminatorColumn for schema generation.tableInfo - table info.entityType - entity type.private List<TableInfo> getSchemaInfo(String persistenceUnit)
persistenceUnit - persistence unit, for which schema needs to be fetched.TableInfoprivate Map<String,EntityMetadata> getEntityMetadataCol(ApplicationMetadata appMetadata, String persistenceUnit)
EntityMetadata.appMetadata - application metadatapersistenceUnit - persistence unitprivate EmbeddedColumnInfo getEmbeddedColumn(TableInfo tableInfo, javax.persistence.metamodel.EmbeddableType embeddableType, String embeddableColName, Class embeddedEntityClass, Field field)
embeddableType - embeddableColName - embeddedEntityClass - field - private ColumnInfo getColumn(TableInfo tableInfo, javax.persistence.metamodel.Attribute column, PropertyIndex indexedColumn, String[] orderByColumns)
Object - of Column.private String getOrderByColumn(String[] orderByColumns, javax.persistence.metamodel.Attribute column)
String - [] orderByColumnsAttribute - columnprivate ColumnInfo getJoinColumn(TableInfo tableInfo, String joinColumnName, Class columnType)
columnType - String - joinColumnName.private String getSchemaProperty(String persistenceUnit, Map<String,Object> externalProperties)
externalProperties - String - persistenceUnit.Copyright © 2015. All Rights Reserved.