This event is fired whenever a many-valued association is processed. This means a foreign key in the database becomes a class field and property of type TList<T> and attributes ManyValuedAssociation and ForeignJoinColumn are added to the class field. Should be declared as following:
procedure OnManyValuedAssociationGenerated(Args: TManyValuedAssociationGeneratedArgs);
begin
end;
Args is of type TManyValuedAssociationGeneratedArgs and has the following properties:
Property |
Description |
Prop: TCodeMemberProperty |
The public property of type TList<T>. |
Field: TCodeMemberField |
The private field of type Proxy<TList<T>>. |
CodeUnit: TCodeUnit |
The Pascal unit where this class is declared. |
CodeType: TCodeTypeDeclaration |
The type declaration of the class containing the property/field |
Getter: TCodeMemberMethod |
The private getter method used as the reader of the public property. |
AssociationAttr: TCodeAttributeDeclaration |
The [ManyValuedAssociation] custom attribute added to the private field. |
ConstructorMethod: TCodeMemberConstructor |
The constructor Create method of the class, used to add the TList<T>.Create statement that instantiates the list object. |
DestructorMethod: TCodeMemberDestructor |
The destructor Destroy method of the class, used to add the TList<T>.Destroy statement that destroys the list object. |
DBRelationship: TGDAORelationship |
Metadata for the database relationship (foreign key) in database. |