Mapping array references of a ContactManager contact

The method arrayMapping(Entity#ArrayKey) maps array references for ABContact entities and subentities. You can use the following additional qualifying methods as well:

withMappingDirection(TO_XML)
Specifies that the array reference is mapped to the core application.
withMappingDirection(TO_BEAN)
Specifies that the array reference is mapped from the core application.

Use the fieldMapping method to map all the fields of the entity to which an array reference refers.

For example, the array extension example Extending contacts with an array adds a new entity named ContactServiceState. This entity represents a state in which a vendor contact operates. Each vendor can operate in more than one state, so the example adds an array reference to ABContact named ContactServiceArea that references an array of ContactServiceState entities.

Note: The example also creates a ClaimCenter ContactServiceState entity and a ContactServiceArea array reference on the ClaimCenter Contact entity.

To transfer this data into and out of ContactManager, you define the array reference and map the fields of the entity to which it refers in ContactMapper, as follows:

arrayMapping(ABContact#ContactServiceArea),
fieldMapping(ContactServiceState#LinkID)
  .withMappingDirection(TO_XML),
fieldMapping(ContactServiceState#External_PublicID),
fieldMapping(ContactServiceState#External_UniqueID),
fieldMapping(ContactServiceState#ServiceState)