2017-07-24 30 views

回答

0

事實證明,你可以同時做到這一點 - 只要我能在RTFM時看到樹木。

https://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGRepositoryGuide/html/s0611itemdescriptorinheritance01.html

替換 「衣」 與類型A, 「襯衫」 用而TYPEx和 「短褲」 與鍵入y

<!-- The "clothing" item type, a base type --> 
<item-descriptor name="clothing" sub-type-property="type"> 

    <!-- This is the primary table that holds clothing data --> 
    <table name="clothing" type="primary" id-column-names="id"> 
    <property name="type" data-type="enumerated"> 
     <option value="shirt"/> 
     <option value="shorts"/> 
    </property> 
    <property name="name"/> 
    <property name="description"/> 
    <property name="color"/> 
    <property name="size"/> 
    <property name="shippingWeight"/> 
    </table> 
</item-descriptor> 

<!-- The "shirt" item type is a subclass of "clothing" --> 
<item-descriptor name="shirt" super-type="clothing" sub-type-value="shirt"> 
    <table name="shirt" type="auxiliary" id-column-names="id"> 
    <property name="season"/> 
    </table> 
</item-descriptor> 

<!-- The "shorts" item type, now a subclass of "clothing" --> 
<item-descriptor name="shorts" super-type="clothing" sub-type-value="shorts"> 
    <table name="shorts" type="auxiliary" id-column-names="id"> 
    <property name="pleated" data-type="boolean"/> 
    </table> 
</item-descriptor> 

,如果你類型A被實例化的,則

<!-- The "clothing" item type, a base type --> 
<item-descriptor name="clothing" sub-type-property="type" 
           sub-type-value="clothing"> 
    <!-- This is the primary table that holds clothing data --> 
    <table name="clothing" type="primary" id-column-names="id"> 
    <property name="type" data-type="enumerated"> 
     <option value="clothing"/> 
     <option value="shirt"/> 
     <option value="shorts"/> 
    <property/> 
    ... 
相關問題