Chapter 4 Generating Hibernate Persistent Objects and JSF Pages


Mapping many-to-many associations

Most many-to-many associations have association-specific attributes. In general, these attributes should be defined in an association class, but since PowerDesigner does not support association classes for Hibernate, you will need to transform the association class to a normal class.

The join table that will support a many-to-many association is automatically generated when you generate a PDM from the OOM.

Steps To manually define the mapping:

  1. Open the association property sheet and click the Mapping tab.
  2. Add the join table and the two references. The following diagram shows the many-to-many association:


    The following diagram shows the generated join table:

 


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