hello,

I use Mapping Classes on Multiple Joined Tables to map an Object which 
inherits from another into two tables.
BUT: is there a way to get the different objects back, when querying?
I mean, I have following mappings:
--------------------------------------------------
<class-descriptor class="item.Item" table="items">
    
    <object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl" />

    <field-descriptor
                     name="itemCode"
                     column="item_code"
                     jdbc-type="INTEGER"
                     primarykey="true"
                     autoincrement="true" />

    <field-descriptor
                     name="name"
                     column="item_name"
                     jdbc-type="VARCHAR" />

</class-descriptor>

<class-descriptor class="item.concreteItems.Book" table="items_books">
    <object-cache class="org.apache.ojb.broker.cache.ObjectCacheEmptyImpl" />

    <field-descriptor
                     name="itemCode"
                     column="fk_item_code"
                     jdbc-type="INTEGER"
                     primarykey="true" />    
    <field-descriptor
                     name="isbn"
                     column="isbn"
                     jdbc-type="VARCHAR" />
    <field-descriptor
                     name="author"
                     column="author"
                     jdbc-type="VARCHAR" />
    <field-descriptor
                     name="publisher"
                     column="publisher"
                     jdbc-type="VARCHAR" />
    
    <reference-descriptor name="super" class-ref="item.Item"
        auto-retrieve="true"
        auto-update="true"
        auto-delete="true"
    >
        <foreignkey field-ref="itemCode" />
    </reference-descriptor>
</class-descriptor>
--------------------------------------------------
but when doing a query by Criteria: new QueryByCriteria(Item.class);
I DO not get the "books" as book > instead they are just items :(
I also used in the item mapping "extends" but this did not solve my problem...

It would be very nice if someone could tell me where my problem is.

thanks in advance,
stefan walkner

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to