Mapping foreign keys of a ContactManager contact

The method fkMapping(Entity#ForeignKey) maps foreign keys for ABContact entities, subentities, and join tables. You can use the following additional qualifying methods as well:

withMappingDirection(TO_XML)
Specifies that the foreign key is mapped to the core application.
withMappingDirection(TO_BEAN)
Specifies that the foreign key is mapped from the core application.

Use the fieldMapping method to map all the fields of the entity to which a foreign key refers.

For example, the foreign key on ABContactAddress that points to an Address object is defined as follows:

fkMapping(ABContactAddress#Address),

Additionally, the fields for the Address object must also be defined by using fieldMapping method calls. The code for the Address entity referenced by the foreign key is:

fieldMapping(Address#LinkID)
  .withMappingDirection(TO_XML),
fieldMapping(Address#External_PublicID),
fieldMapping(Address#AddressLine1),
fieldMapping(Address#AddressLine1Kanji),
fieldMapping(Address#AddressLine2),
fieldMapping(Address#AddressLine2Kanji),
fieldMapping(Address#AddressLine3),
fieldMapping(Address#AddressType),
fieldMapping(Address#City),
fieldMapping(Address#CityKanji),
fieldMapping(Address#Country),
fieldMapping(Address#County),
fieldMapping(Address#Description),
fieldMapping(Address#GeocodeStatus),
fieldMapping(Address#PostalCode),
fieldMapping(Address#State),
fieldMapping(Address#ValidUntil),
fieldMapping(Address#CEDEX),
fieldMapping(Address#CEDEXBureau),