Applying Table Per Class Strategy

Each class should be mapped to its own primary table. All persistent attributes of the class, including inherited persistent attributes, are mapped to columns of the table for the class. Given the following example:





Super classes can be also mapped to primary tables of subclasses if inherited persistent attributes are mapped in different ways for subclasses, for example to different columns. The other primary table can just be secondary tables. PowerDesigner will generate these secondary tables for super classes.

For this kind of strategy, some super classes can have no table mapped. These classes are used to define state and mapping information that can be inherited by their subclasses.

  1. Define entity class mappings for each class in the hierarchy.

    Each class is mapped to its own primary table.

  2. Define attribute mappings and association mappings for each class.
  3. Define identifier mapping in the root class.
  4. Define persistence generation type for each class.
  5. Define persistence generation type of leaf classes as Generate table and all the other classes as Migrate columns.


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