Show/Hide Toolbars

TMS Data Modeler Documentation

Navigation: TMS Aurelius Export > Customization Script

OnAssociationGenerated Event

Scroll Prev Top Next More

This event is fired whenever an association is processed. This means a foreign key in the database becomes a class field of type Proxy<T> and a property of type T where T is an object, and attributes Association and JoinColumn are added to the class field. Should be declared as following:


procedure OnAssociationGenerated(Args: TAssociationGeneratedArgs);


Type TAssociationGeneratedArgs has the following roperties.




Prop: TCodeMemberProperty

The public property of type T.

Field: TCodeMemberField

The private field of type Proxy<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. It might be nil if property is not lazy-loaded.

Setter: TCodeMemberMethod

The private setter method used as the writer of the public property. It might be nil if property is not lay-loaded.

AssociationAttr: TCodeAttributeDeclaration

The [Association] custom attribute added to the private field.

DBRelationship: TGDAORelationship

Metadata for the database relationship (foreign key) in database.