엔티티 어노테이션

엔티티 XML 어노테이션에는 복합 유형을 엔티티로 정의하는 하나의 어노테이션과 엔티티 ID를 정의하는 다른 어노테이션이 포함됩니다.

엔티티 어노테이션

엔티티를 정의하는 복합 유형에 다음 어노테이션을 추가해야 합니다.

<annotation>
 <appinfo source="http://www.ibm.com/ia/Annotation">
  <entity/>
 </appinfo>
</annotation>
이 어노테이션은 com.ibm.ia.model.Entity 인터페이스에 대한 상속을 지정합니다.

엔티티 ID 어노테이션

엔티티의 ID를 정의하는 요소에 다음 어노테이션을 추가해야 합니다.

<annotation>
 <appinfo source="http://www.ibm.com/ia/Annotation">
  <entityId/>
 </appinfo>
</annotation>
ID 어노테이션은 true 값의 BOM 특성 ia.entity.id를 대응되는 BOM 속성에 추가합니다.
참고: XSD 파일에는 엔티티 어노테이션이 있는 각 복합 유형마다 요소 선언이 포함되어 있어야 합니다.

예제

다음 예는 FlightNumber ID가 있는 Flight로 이름 지정된 엔티티를 정의합니다.

<element name="Flight_entity" type="tns:Flight"/>
<complexType name="Flight">
  <annotation>
   <appinfo source="http://www.ibm.com/ia/Annotation">
    <entity/>
   </appinfo>
 </annotation>
  <sequence>
   <element name="FlightNumber" type="integer">
    <annotation>
     <appinfo source="http://www.ibm.com/ia/Annotation">
       <entityId/>
     </appinfo>
    </annotation>
   </element>
  </sequence>
</complexType>