関係のインプリメント

Relationship Designer Express で関係定義を作成したら、マップ内に関係をインプリメントできます。関係定義の作成については、関係定義の作成を参照してください。

関係をインプリメントするには、マップの宛先オブジェクトに relationship 関数ブロックを使用するか、マップの宛先オブジェクト内の属性のコードにマッピング API メソッドを追加します。

表 89 に、使用する関数ブロックを示します。

表 89. Relationship の関数ブロック
関係の種類 関数ブロック 詳細情報の参照先
参照 General/APIs/Relationship/Retrieve Instances
General/APIs/Relationship/Retrieve Participants
"参照関係の使用"
単純 ID General/APIs/Identity Relationship/Maintain Simple Identity Relationship
/General/APIs/Identity Relationship/Maintain Child
Verb
"単純一致関係の使用"
複合 ID General/APIs/Identity Relationship/Maintain
Composite Relationship
General/APIs/Identity Relationship/Maintain Child
Verb
General/APIs/Identity Relationship/Update My Children (オプション)
"複合一致関係の使用"
カスタム General/APIs/Relationship/Create Relationship
General/APIs/Identity Relationship/Add My Children
General/APIs/Relationship/Add Participant

表 89 に、別の種類の関係を維持するマッピング API メソッドを示します。

表 90. 関係のマッピング API メソッド
関係の種類 マッピング API メソッド 詳細情報の参照先
参照 retrieveInstances()retrieveParticipants() 参照関係の使用
単純 ID maintainSimpleIdentityRelationship()
maintainChildVerb()
"単純一致関係の使用"
複合 ID maintainCompositeRelationship()maintainChildVerb()
updateMyChildren()(オプション)
"複合一致関係の使用"
カスタム create()addMyChildren()addParticipant() "カスタム関係の維持"

関係属性を変換する場合は、マップの呼び出しコンテキストをマップが認識する必要があります。

呼び出しコンテキストを判別するには、マップの実行コンテキストの次の情報がマップに必要です。

これらの 2 つの要因により、関係表に行う必要のあるアクションをマップが認識します。

表 89 の関係の場合、関連するマッピング API メソッドにより関係表に該当する操作が実行されます。したがって、これらのメソッドでは、呼び出しコンテキストとビジネス・オブジェクト動詞が引き数として渡される必要があります。

Copyright IBM Corp. 2004