6.2.5. Collections of Values and Many-to-many Associations
このコンテンツは選択した言語では利用できません。
6.2.5. Collections of Values and Many-to-many Associations
Any collection of values or many-to-many associations requires a dedicated collection table with a foreign key column or columns, collection element column or columns, and possibly an index column or columns.
For a collection of values use the <element> tag. For example:
Copy to ClipboardCopied!Toggle word wrapToggle overflow
column (optional): the name of the element foreign key column.
formula (optional): an SQL formula used to evaluate the element foreign key value.
class (required): the name of the associated class.
fetch (optional - defaults to join): enables outer-join or sequential select fetching for this association. This is a special case; for full eager fetching in a single SELECT of an entity and its many-to-many relationships to other entities, you would enable join fetching,not only of the collection itself, but also with this attribute on the <many-to-many> nested element.
unique (optional): enables the DDL generation of a unique constraint for the foreign-key column. This makes the association multiplicity effectively one-to-many.
not-found (optional - defaults to exception): specifies how foreign keys that reference missing rows will be handled: ignore will treat a missing row as a null association.
entity-name (optional): the entity name of the associated class, as an alternative to class.
property-ref (optional): the name of a property of the associated class that is joined to this foreign key. If not specified, the primary key of the associated class is used.