Table of Contents

ManyValuedAssociationAttribute Class

Specifies a one-to-many association between the marked field or property and a collection of child entity objects.

Remarks

Use ManyValuedAssociation on fields or properties of type TList<T> where T is an entity class. The child table must reference the parent table via a foreign key, established either by adding a ForeignJoinColumn attribute (unidirectional) or by specifying the MappedBy parameter pointing to an Association field in the child class (bidirectional). For many-valued associations, CascadeTypeAll or CascadeTypeAllRemoveOrphan are the most commonly recommended cascade types. Lazy loading is strongly recommended for lists because eager loading does not reduce the number of SQL statements executed.

Syntax

Unit: Aurelius.Mapping.Attributes

ManyValuedAssociationAttribute = class(AssociationAttribute);

Constructors

Name Description
Create Creates a ManyValuedAssociationAttribute with association properties, cascade behaviour, and a mapped-by member name.

Methods

Name Description
Clone Returns a deep copy of this attribute instance.

Properties

Name Description
MappedBy Gets or sets the name of the field or property in the child entity that holds the back-reference association.