Generating the database schema

 

General principle

Generation for relational databases takes into account the model in terms of its:

·         classes

·         associations

·         generalizations

·         attributes

 

 

Using tagged values

Tagged values describe specific RDBMS notions in the Objecteering model.  The characteristics of the target RDBMS (cluster, structure, etc.) can be accessed using additional tagged values.

 

Furthermore, parameterization lets you add your own tagged values, in order to adapt SQL Designer to your own specific generation operations.

 

 

Mapping rules

The rules for mapping object model notions in the tables of a relational database are as follows:

 

The ... object model

relational databases ...

class

table

association

table or columns and outside keys

instance

not managed by Objecteering SQL Designer

attribute

a table's column

generalization

3 alternatives: one table per concrete class (with copying specialized attributes) , one table per class( without copying specialized attributes), or only one table for the complete hierarchy

{primaryKey} tagged value

primary key

{index} tagged value

index

one or more packages

according to the stereotype (schema, database, physical model)

 

 

Example

 

Figure 17. Example of mapping

 

This gives the following in SQL:

CREATE DEPARTMENT TABLE(

       NUMBER...,

       NAME...,

       LOCATION...);