| Modifier and Type | Field and Description |
|---|---|
| protected Map | databaseFields
DatabaseField pool (synchronized with above 'fieldMap') |
| protected DatabasePlatform | databasePlatform
the target database platform. |
| protected Map | fieldMap
Used to track the field definition: keyed by the database field object, and valued by the field definition. |
| protected boolean | generateFKConstraints
When this flag is 'false' EclipseLink will not attempt to create fk constraints. |
| pack-priv Project | project
The project object used to generate the default data schema. |
| protected Map | tableMap
Used to track the table definition: keyed by the table name, and valued by the table definition object. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultTableGenerator(Project project, boolean generateFKConstraints)
This constructor will create a DefaultTableGenerator that can be set to create fk constraints |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addFieldsForMappedKeyMapContainerPolicy(ContainerPolicy cp, TableDefinition table)
The ContainerPolicy may contain some additional fields that should be added to the table |
| protected void | addForeignKeyConstraint(TableDefinition sourceTableDef, TableDefinition targetTableDef, List<String> fkFields, List<String> targetFields, boolean cascadeOnDelete)
Add a foreign key constraint to the source table. |
| protected void | |
| protected void | |
| protected void | addForeignMappingFkConstraint(final Map<DatabaseField, DatabaseField> srcFields, boolean cascadeOnDelete)
|
| protected void | addJoinColumnsFkConstraint(List<DatabaseField> fkFields, List<DatabaseField> targetFields, boolean cascadeOnDelete)
|
| protected void | addUniqueKeyConstraints(TableDefinition sourceTableDef, Map<String, List<List<String>>> uniqueConstraintsMap)
|
| protected void | buildDirectCollectionTableDefinition(DirectCollectionMapping mapping, ClassDescriptor descriptor)
Build direct collection table definitions in a EclipseLink descriptor |
| protected void | buildRelationTableDefinition(ForeignReferenceMapping mapping, RelationTableMechanism relationTableMechanism, DatabaseField listOrderField, ContainerPolicy cp)
Build relation table definitions for all many-to-many relationships in a EclipseLink descriptor. |
| protected void | buildRelationTableFields(ForeignReferenceMapping mapping, TableDefinition table, List<DatabaseField> fkFields, List<DatabaseField> targetFields)
Build field definitions and foreign key constraints for all many-to-many relation table. |
| protected void | createAggregateTargetTable(AggregateCollectionMapping mapping)
Add the foreign key to the aggregate collection mapping target table. |
| public TableCreator | generateDefaultTableCreator()
Generate a default TableCreator object from the EclipseLink project object. |
| public TableCreator | generateFilteredDefaultTableCreator(AbstractSession session)
Generate a default TableCreator object from the EclipseLink project object, and perform the table existence check through jdbc table metadata, and filter out tables which are already in the database. |
| protected FieldDefinition | |
| protected TableDefinition | getTableDefFromDBTable(DatabaseTable databaseTable)
Build a table definition object from a database table object |
| protected void | initTableSchema(ClassDescriptor descriptor)
Build tables/fields information into the table creator object from a EclipseLink descriptor. |
| protected void | postInitTableSchema(ClassDescriptor descriptor)
Build additional table/field definitions for the descriptor, like relation table and direct-collection, direct-map table, as well as reset LOB type for serialized object mapping and type conversion mapping for LOB usage |
| protected void | |
| protected void | resetFieldTypeForLOB(DirectToFieldMapping mapping)
Reset field type to use BLOB/CLOB with type conversion mapping fix for 4k oracle thin driver bug. |
| protected void | resetTransformedFieldType(TransformationMapping mapping)
Reset the transformation mapping field types |
| protected DatabaseField | resolveDatabaseField(DatabaseField childField, DatabaseField parentField)
Resolve the foreign key database field metadata in relation table or direct collection/map table. |
| protected void | setFieldToRelationTable(DatabaseField dbField, TableDefinition table)
Build and add a field definition object to relation table |
| databaseFields | back to summary |
|---|---|
| protected Map<DatabaseField, DatabaseField> databaseFields DatabaseField pool (synchronized with above 'fieldMap') | |
| databasePlatform | back to summary |
|---|---|
| protected DatabasePlatform databasePlatform the target database platform. | |
| fieldMap | back to summary |
|---|---|
| protected Map<DatabaseField, FieldDefinition> fieldMap Used to track the field definition: keyed by the database field object, and valued by the field definition. | |
| generateFKConstraints | back to summary |
|---|---|
| protected boolean generateFKConstraints When this flag is 'false' EclipseLink will not attempt to create fk constraints. | |
| project | back to summary |
|---|---|
| pack-priv Project project The project object used to generate the default data schema. | |
| tableMap | back to summary |
|---|---|
| protected Map<String, TableDefinition> tableMap Used to track the table definition: keyed by the table name, and valued by the table definition object. | |
| DefaultTableGenerator | back to summary |
|---|---|
| public DefaultTableGenerator(Project project) Default constructor | |
| DefaultTableGenerator | back to summary |
|---|---|
| public DefaultTableGenerator(Project project, boolean generateFKConstraints) This constructor will create a DefaultTableGenerator that can be set to create fk constraints | |
| addFieldsForMappedKeyMapContainerPolicy | back to summary |
|---|---|
| protected void addFieldsForMappedKeyMapContainerPolicy(ContainerPolicy cp, TableDefinition table) The ContainerPolicy may contain some additional fields that should be added to the table
| |
| addForeignKeyConstraint | back to summary |
|---|---|
| protected void addForeignKeyConstraint(TableDefinition sourceTableDef, TableDefinition targetTableDef, List<String> fkFields, List<String> targetFields, boolean cascadeOnDelete) Add a foreign key constraint to the source table. | |
| addForeignKeyFieldToSourceTargetTable | back to summary |
|---|---|
| protected void addForeignKeyFieldToSourceTargetTable(OneToOneMapping mapping) | |
| addForeignKeyFieldToSourceTargetTable | back to summary |
|---|---|
| protected void addForeignKeyFieldToSourceTargetTable(OneToManyMapping mapping) | |
| addForeignMappingFkConstraint | back to summary |
|---|---|
| protected void addForeignMappingFkConstraint(final Map<DatabaseField, DatabaseField> srcFields, boolean cascadeOnDelete) | |
| addJoinColumnsFkConstraint | back to summary |
|---|---|
| protected void addJoinColumnsFkConstraint(List<DatabaseField> fkFields, List<DatabaseField> targetFields, boolean cascadeOnDelete) | |
| addUniqueKeyConstraints | back to summary |
|---|---|
| protected void addUniqueKeyConstraints(TableDefinition sourceTableDef, Map<String, List<List<String>>> uniqueConstraintsMap) | |
| buildDirectCollectionTableDefinition | back to summary |
|---|---|
| protected void buildDirectCollectionTableDefinition(DirectCollectionMapping mapping, ClassDescriptor descriptor) Build direct collection table definitions in a EclipseLink descriptor | |
| buildRelationTableDefinition | back to summary |
|---|---|
| protected void buildRelationTableDefinition(ForeignReferenceMapping mapping, RelationTableMechanism relationTableMechanism, DatabaseField listOrderField, ContainerPolicy cp) Build relation table definitions for all many-to-many relationships in a EclipseLink descriptor. | |
| buildRelationTableFields | back to summary |
|---|---|
| protected void buildRelationTableFields(ForeignReferenceMapping mapping, TableDefinition table, List<DatabaseField> fkFields, List<DatabaseField> targetFields) Build field definitions and foreign key constraints for all many-to-many relation table. | |
| createAggregateTargetTable | back to summary |
|---|---|
| protected void createAggregateTargetTable(AggregateCollectionMapping mapping) Add the foreign key to the aggregate collection mapping target table. Also add listOrderField if specified. | |
| generateDefaultTableCreator | back to summary |
|---|---|
| public TableCreator generateDefaultTableCreator() Generate a default TableCreator object from the EclipseLink project object. | |
| generateFilteredDefaultTableCreator | back to summary |
|---|---|
| public TableCreator generateFilteredDefaultTableCreator(AbstractSession session) throws DatabaseException Generate a default TableCreator object from the EclipseLink project object, and perform the table existence check through jdbc table metadata, and filter out tables which are already in the database. | |
| getFieldDefFromDBField | back to summary |
|---|---|
| protected FieldDefinition getFieldDefFromDBField(DatabaseField dbField) Build a field definition object from a database field. | |
| getTableDefFromDBTable | back to summary |
|---|---|
| protected TableDefinition getTableDefFromDBTable(DatabaseTable databaseTable) Build a table definition object from a database table object | |
| initTableSchema | back to summary |
|---|---|
| protected void initTableSchema(ClassDescriptor descriptor) Build tables/fields information into the table creator object from a EclipseLink descriptor. This should handle most of the direct/relational mappings except many-to-many and direct collection/map mappings, which must be down in postInit method. | |
| postInitTableSchema | back to summary |
|---|---|
| protected void postInitTableSchema(ClassDescriptor descriptor) Build additional table/field definitions for the descriptor, like relation table and direct-collection, direct-map table, as well as reset LOB type for serialized object mapping and type conversion mapping for LOB usage | |
| processAdditionalTablePkFields | back to summary |
|---|---|
| protected void processAdditionalTablePkFields(ClassDescriptor descriptor) | |
| resetFieldTypeForLOB | back to summary |
|---|---|
| protected void resetFieldTypeForLOB(DirectToFieldMapping mapping) Reset field type to use BLOB/CLOB with type conversion mapping fix for 4k oracle thin driver bug. | |
| resetTransformedFieldType | back to summary |
|---|---|
| protected void resetTransformedFieldType(TransformationMapping mapping) Reset the transformation mapping field types | |
| resolveDatabaseField | back to summary |
|---|---|
| protected DatabaseField resolveDatabaseField(DatabaseField childField, DatabaseField parentField) Resolve the foreign key database field metadata in relation table or direct collection/map table. Those metadata includes type, and maybe dbtype/size/subsize if DatabaseField carries those info. | |
| setFieldToRelationTable | back to summary |
|---|---|
| protected void setFieldToRelationTable(DatabaseField dbField, TableDefinition table) Build and add a field definition object to relation table | |