[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ojb-user
Subject:    Re: Mapping Classes on Multiple Joined Tables
From:       Armin Waibel <arminw () apache ! org>
Date:       2005-04-20 18:19:14
Message-ID: 42669D22.8040203 () apache ! org
[Download RAW message or body]

Hi Stefan,

Stefan Walkner wrote:
> 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:

we start working on this issue. Hope till next release this will be fixed.

regards,
Armin

> --------------------------------------------------
> <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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic