
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:
To define a table per class hierarchy:
- Open the property sheet of the root class, click the Details tab, and select "Migrate column".
- 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.
- Open the property sheet of a subclass, click the Details tab, and select "Generate table".
- Generate a PDM with O/R mapping.
- Verify the mapping file in the Preview tab of the class property sheet of each class.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|