maintainCompositeRelationship()

Maintains a composite identity relationship from within the parent map.

Syntax

public static void maintainCompositeRelationship(String relDefName, 
       String particpntDefName, BusObj appSpecificBusObj, 
       Object genericBusObjList, CxExecutionContext map_ctx)
 

Parameters

relDefName
The name of the composite identity relationship (as defined in Relationship Designer Express) in which the parent attribute participates.
particpntDefName
The name of the participant that includes the composite key. This participant is always application-specific.
appSpecificBusObj
The variable that contains the application-specific business object used in this map. This business object is the parent business object.
genericBusObjList
The variable that contains the generic business object or objects used in this map, each generic business object is a contained child business object of the generic parent object. This parameter can be either a single generic business object (BusObj) or an array of generic business objects (BusObjArray).
map_ctx
The map execution context. To pass the map execution context, use the cwExecCtx variable, which Map Designer Express defines for every map.

Return values

None.

Exceptions

RelationshipRuntimeException 
 
CxMissingIDException
If a participant does not exist in the relationship tables during a map execution with a verb of Retrieve and an calling context of SERVICE_CALL_REQUEST. The connector sends a "service call request failed" message to the collaboration without sending the business object to the application.

Notes

The maintainCompositeRelationship() method maintains the relationship table associated with the particpntDefName participant of the relDefName composite identity relationship. This method maintains a relationship whose participant uses keys from multiple business objects at different levels (a composite key).

Note:
The maintainCompositeRelationship() method cannot handle the case where the child's composite key depends on its grandparents. For more information, see "Actions of General/APIs/Identity Relationship/Maintain Composite Relationship".

This method iterates through all the child business objects in the appSpecificObj parent business object, maintaining the relationship instances in the partDefName participant's relationship table. The method obtains the relationship instance IDs from the array of generic business objects that it receives (genericObjs). For each child instance, maintainCompositeRelationship() calls the maintainSimpleIdentityRelationship() method to perform the actual relationship-table management. The action that maintainSimpleIdentityRelationship() takes depends on the following information:

For more information on the actions that maintainSimpleIdentityRelationship() takes, see "Accessing identity relationship tables". Table 74 through Table 78 provide the actions for each of the calling contexts.

Use maintainCompositeRelationship() in conjunction with the maintainChildVerb() and updateMyChildren() methods to maintain a composite relationship. For more information, see "Customizing map rules for a composite identity relationship".

Examples

// This is an example of a code fragment in a parent map. It maintains
 // the relationship table for all instances of a child object type for
 // this application-specific parent object.
  
 BusObjArray secondLevel2 =
       (BusObjArray)ObjFirstLevelBusObj2.get("MultiCardChild");
  
 IdentityRelationship.maintainCompositeRelationship(
    "CmposRel", 
    "AppSpPrt",
    ObjFirstLevelBusObj2, 
    secondLevel2, 
    cwExecCtx);
  
 IdentityRelationship.updateMyChildren(
    "PCRel", 
    "Parent",
    ObjFirstLevelBusObj2, 
    "Child", 
    "MultiCardChild", 
    "CmposRel", 
    "AppSpPrt",
    cwExecCtx);
 

For more examples involving maintainCompositeRelationship(), see "Customizing map rules for a composite identity relationship".

See also

updateMyChildren(), maintainChildVerb(), maintainSimpleIdentityRelationship()

"Using composite identity relationships"

Copyright IBM Corp. 2003