10.07.2015 Views

Using Data Modeler

Using Data Modeler

Using Data Modeler

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Target <strong>Data</strong>baseWhen you specify a Target, which is the database name, you must select a name fromthe list. If you leave the Target blank, your specification dialog boxes will beunavailable to you after the transformation is complete.PrefixesYou can distinguish your new tables from the classes in your object model byassigning a prefix to them. It is recommended you use a prefix. The prefix will appearbefore each of your tables’ names and will help you avoid drawing relationshipsbetween a table and a class or vice versa, making your object model or data modelinvalid.Indexes for Foreign KeysAs an additional convenience, you can specify to have an index built for every foreignkey in your new data model. When you click OK on this dialog box, the actualtransformation process begins.Transforming Packages, Classes, and AssociationsIn the actual transformation process, <strong>Data</strong> <strong>Modeler</strong> generates a schema or executes adestructive rewrite using the schema name you designated in the Transform Object Modelto <strong>Data</strong> Model dialog box. Then <strong>Data</strong> <strong>Modeler</strong> reads the object model package looking forpersistent classes and relationships between persistent classes. These classes aretransformed to tables in the data model.At this point, <strong>Data</strong> <strong>Modeler</strong> looks for any attributes assigned as candidate keys in thepersistent classes. If there are attributes assigned as candidate keys, each of these keysare transformed to primary keys and are added to the table’s primary key constraintwith unique indexes being created for each constraint. If none of the attributes areassigned as a candidate key, <strong>Data</strong> <strong>Modeler</strong> adds an ID-based column to the parenttables and assigns that column as the primary key for the table. This process ensuresthat all the parent tables have a primary key, so all relationships will be valid.Thereafter, all other attributes are added to the table as columns.Once the tables are established, <strong>Data</strong> <strong>Modeler</strong> transforms the object modelassociations to data model relationships. Each of the relationships receives theappropriate cardinality and roles as designated in the object model. Also, each of therelationships migrates a foreign key to the child table based on the primary key in theparent table. If you specified to have an index built for each foreign key, these indexesare generated after the foreign key migrates from the parent to the child table. Thisalso includes any special structures like those that transform to intersection tables.26 Chapter 3 - Logical <strong>Data</strong> Modeling

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!