Associations define relationships between entities.
You can specify either a managed or unmanaged association.
Association Type/Steps |
Join Properties/Generated Code |
---|---|
[default] Implicitly use the target entity's primary key as foreign key. |
Code:
Address_1: Association to Address; |
To explicitly specify the target entity's primary key (e.g. id), as the foreign key, select it in the Parent Table Column column. |
Code:
Address_2: Association to Address { id }; |
To specify one or more other elements from the target entity as foreign key elements, select them (e.g. zipcode, street, and country) in the Parent Table Column column. |
Code:
Address_3: Association[1] to Address { zipCode, street, country }; |
To specify a cardinality for the association (e.g. 0..*), select or enter it in the CDS Cardinality field. |
Code:
Address_4: Association[0..*] to Address { zipCode }; |
To specify sub-elements from structured types as foreign key elements, enter them manually (e.g. street.name in the Sub-Element column. |
Code:
Address_5: Association[*] to Address { street.name }; |
To specify an alias for any of the foreign key elements, enter it in the Alias column. |
Code:
Address_6: Association[*] to Address { street.name as streetName, country.name as countryName }; |
Association Type/Steps |
Join Properties/Generated Code |
---|---|
|
Code:
inhabitants: Association[*] to Employee on id = inhabitants.officeId; |