Defining Object Persistence in the OOM

Persistent codes are defined for OOM classes and attributes. They are used during OOM to PDM generation in order to fine tune data storage in a relational database. They also facilitate round-trip engineering by allowing to recover object codes from the database.

You can define the type of persistence you want to implement in the Persistent group box in the Detail tab of a class property sheet:


Attribute and associations of persistent classes with a persistence generation mode set to "Migrate columns" are migrated to parent or child tables.

You can also define persistent data types for class attributes and domains. For data type persistence management, you have to take into account the following parameters:


Attribute Migration

If you generate the following OOM into a PDM:



The migration of attributes in the generated PDM depends on the persistence option of the classes in the source OOM:

Persistence

Result

Parent and child / Generate table

Two tables are created for each class

Parent / Migrate columns Child / Generate table

Table Child is generated with parent attributes

Parent / Generate table Child / Migrate columns

Table Parent is generated, with child attributes

Parent and child / Migrate columns

Nothing is generated

Inherited Attributes

In the following OOM, class Customer inherits from Person via a generalization link. Person is not persistent but Customer is persistent.



Customer inherits the attributes of the parent class in the generated PDM:



Derived Class

A derived class is created for conceptual reasons to improve the readability of a model but it adds no semantic information. There is no point of generating a derived class in a PDM, and attributes of this class should be migrated to parent.

In the following example, class Women is created to further analyze class Employee and highlight a specific attribute "Maternity leave". This class is derived, thus not generated but persistent:



In the generated PDM, Employee inherits from parent class and also from derived class:




Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com