Chapter 4 Generating Hibernate Persistent Objects and JSF Pages


Table per concrete class hierarchy

Using a table per concrete class hierarchy means that all the attributes of the parent class are migrated to all its subclasses.

All the properties of a class, including any inherited properties, could be mapped to columns of the table:


Steps To define a table per class hierarchy:

  1. Open the property sheet of the root class, click the Details tab, and select "Migrate column".
  2. Click the Hibernate tab and set the Abstract class option to true. This option is specific to Hibernate, and is different from Java's abstract class syntax.
  3. Open the property sheet of a subclass, click the Details tab, and select "Generate table".
  4. Generate a PDM with O/R mapping.
  5. Verify the mapping file in the Preview tab of the class property sheet of each class.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.