You are here: Innovator for Database Architects > Mapping Between the Database Schema and Conceptual Model > Mapping the Conceptual Model in the Database Schema

Mapping the Conceptual Model in the DB Schema

Mapping enables you to model in the conceptual model and create a database model.

General

ER-DB mapping is created based on M2M SDK; it has all options with regard to customization and extension that you get in M2M SDK.

What is Mapped?

  1. The user selection should be adopted.
    1. All model elements should be mapped upon multiple selection.
    2. The model should be mapped if a model is selected.
    3. The package should be mapped if a package is selected.
    4. The entity should be mapped if a entity is selected.
    5. The view should be mapped if a view is selected.
    6. If a semantic data type is selected, the semantic data type should be mapped if the option is de.mid.data.UseSDTinDB=true; this is not the default setting.
    7. The sequence should be mapped if a sequence is selected.
    8. The diagram should be mapped if a diagram is selected.
    9. Other elements selected are ignored.
  2. Dependent elements should be adopted.
    1. If a view is selected, the view and entities and views used are mapped.
    2. If a diagram is selected, the diagram's contents is mapped.
    3. The semantic data type or sequence or data type definition used for an attribute is mapped; this also applies for a foreign key attribute's derived type.
    4. A sequence's foreign key type is mapped.
    5. The foreign key which points to a mapped entity or view in a mapped entity is mapped. i.e. special or general entities or those linked using connections are not mapped if they were already mapped. The user needs to explicitly map these entities.
    6. The whole transitive content of a model element is always mapped.
    7. The transitive owner of all mapped model elements is also mapped. Exception: Sequences and semantic data types

What is Created in the DB?

  1. Nothing is created if a model element is already connected in the DB; this model element may be modified.
  2. One package from ER should be mapped in a package in DB. There is always the same owner for all packages in DB. Depending on the type system, this is the model or catalog.
  3. Tables, views, columns, keys and foreign keys are created from entities, views, attributes, keys and foreign keys. Tables and views are either created in the respective package or in accordance with the create defaults.
  4. Indexes are only created from unique keys if the option is de.mid.data.CreateIndex=true; this is not the default setting.
  5. Indexes are only created from foreign keys if the option is de.mid.data.CreateFKIndex=true; this is not the default setting.
  6. The diagram is created as per name and owner. Create defaults which may exist are taken into consideration. Creation only takes place if a diagram with the same name does not already exist there and if the de.mid.data.CreateDiagram=true option is set (which is set as default). The diagram content (nodes and edges included, visibility of the compartment and size and placement of the nodes) is not updated if the de.mid.data.MaintainDiagram=false option is set (which is set as default). To be able to refresh a diagram upon mapping, you therefore need to delete it, rename it, move it to another package or set the option de.mid.data.MaintainDiagram=true.
  7. A semantic data type is not created from a semantic data type if de.mid.data.UseSDTinDB=false is set (this is set as default). A semantic data type is only created for a semantic data type that is the foreign key type of a sequence. If a semantic data type is created, it is created according to the create defaults.
  8. Data type definition of a column or semantic data type is calculated from the data type definition in the conceptual model in accordance with the type mapping in the conceptual model's type system. However, if the existing data type definition in the database model can be mapped according to the type mapping in the database model's type system then nothing is replaced. If the same type system is used in the conceptual and database model, then the same type is used.
  9. A constraint for disjunctive tables is created from a generalization set whose generalizations have foreign keys. The name of the constraint is the name made up of the general entity and generalization set.
  10. A sequence is created from a sequence. The sequences is created in accordance with the create default.
  11. Foreign keys are not created from a relationship, generalization or generalization set in the DB. This is why a foreign key is needed in the conceptual model, otherwise no connection to the table will be shown in the database diagram. The option "ON DELETE CASCADE" is created on the foreign key in the DB for a foreign key to a hierarchical relationship or to a generalization.
  12. The names of the respective model elements are adopted from the conceptual model for packages, tables, columns, views, view columns, from clauses, unique keys and foreign keys. The names are modified each time the mapping is carried out. if the name cannot be set as it is not unique, then a unique name is set instead, e.g. Table_37. If the option de.mid.data.UseDB2Names=true (this is only the standard for DB2-PC or DB2-Host), then DB2-compliant names are created.i.e. upper case, numbers and underscores are OK and lower case is changed; all other symbols are replaced by underscores.

 

 

© 1986-2014 MID GmbH Nuremberg Germany. DIN EN 9001 certified. All rights reserved.