マッピング

マッピングに役立ちます。 熱 意/ヘルプ/ zest -仕様ファイル/構造/導入/"> そのプロパティの 1 つの値に基づいて ( プロパティ名 差別主義者の属性)。 また、既存のマッピングの詳細を上書きするのにも役立ちます。

可能な場所

  • 熱 意/ヘルプ/ zest -仕様ファイル/構造グループ/差別者/導入/">差別者

属性


お名前 タイプ 説明
お名前

必須

文字列 判別者の価値について <property> 構造をマッピングしたいものに基づいて。
構造体名


必須

文字列 マッピングする構造体の名前。

例

雇用する 熱 意/ヘルプ/ zest -仕様ファイル/構造グループ/識別子/マッピング/"> a を参照する場合 熱 意/ヘルプ/ zest -仕様ファイル/構造/導入/"> 開発者が指定していない別のリソースから、 識別子名. これを使用して、以前に設定した 識別子名.旅行リソースでは、お客様のためのフライトと宿泊施設の2つのサービスを提供しています。 選択したサービスに応じて、特定の構造を割り当てる必要があります。 これらのサービスにはそれぞれ個別のリソースがあり、開発者は他のリソースで使用するための構造を宣言しています。フライトリソース開発者は、 識別子名 しかし、判別者を追加しました 熱 意/ヘルプ/ zest -仕様ファイル/構造/プロパティ/導入/"> 構造について。 リソース開発者が指定した宿泊施設 ホテル として 識別子名.以下は、次のように宣言された構造体です。 熱 意/ヘルプ/ zest -仕様ファイル/コンポーネント/"> それぞれの資源

copy

structure in the flights resource:
 <components>
 <structure ref-name="flight_template" name="external_resource_use" >
 <property name="type" type="string" values="Flight" /> <!-- discriminator's property -->
 <property name="flight_no" type="string" />
 <property name="departure_airport" type="string" />
 <property name="arrival_airport" type="string" />
 </structure>
 </components>
copy

structure in the accommodations resource:
 <components>
 <structure ref-name="accommodation_template" name="external_resource_use" discriminator-name="Hotel">
 <property name="hotel_name" type="string" />
 <property name="check_in_date" type="string" />
 <property name="check_out_date" type="string" />
 </structure>
 </components>

次に、フライトテンプレート構造の新しいマッピングを宣言し、次の方法で宿泊施設テンプレート構造の既存のマッピングを上書きする必要があります。

copy

<property name="service" type="map">
 <structure-group name="services" type="one-of">
 <structure-ref name="flights.flight_template" />
 <structure-ref name="accommodations.accommodation_template" />
 <discriminator property-name="type">
 <mapping name="Flight" structure-name="flights.flight_template"/>
 <mapping name="Accommodation" structure-name="accommodations.accommodation_template"/>
 <!-- Hotel is overridden with Accommodation -->
 </discriminator>
 </structure-group>
 </property>

Last Updated 2026-02-06 15:55:45 +0530 IST

ON THIS PAGE