Class associations

 

Class association patterns

The transformation of an association including a class association depends on its multiplicity and on the presence of the {persistence(persistent)} tagged value.

 

Default transformation consists of generating an intermediary table in the same way as a *-* association.  The class association is used as intermediary table (please see "N-ary associations").

 

For an association of 0..1-* multiplicity, and in the aim of limiting the number of tables, the class association can be generated in the table bearing the "*" multiplicity, if the role is annotated {sqlOptimized}.  In this case, all the attributes of the class association are transferred (except those annotated {persistence(transient)}).

 

The analysis model shown in Figure 46 presents this possibility.

 

Figure 46. Analysis model, optimizing a class association

 

It is generated as shown in Figure 47.

 

Figure 47. Physical model, optimizing a class association