Association defined between entity classes will be transformed into reference keys or reference tables. Associations with Value type classes as target or source will be ignored.
Transformation rules differ according to the type of the association:
One-to-one
One-to-many
Many-to-many
One-to-one Association Transformation
For each unidirectional one-to-one association, one foreign key will be generated with the same direction as the association. The primary key of parent table will also migrate into child table as its foreign key.
One-to-many Association Transformation
Unlike one-to-one associations, just one foreign key will be generated for each one-to-many association, whatever its direction (bidirectional or unidirectional). The reference key navigates from the table generated from the entity class on multiple-valued side to the table generated from the entity class on single-valued side.
Many-to-many Association Transformation
Each many-to-many association will be transformed into one middle table and two reference keys that navigate from the middle table to the tables generated from the two entity classes.