ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Bayon <ibatis....@gmail.com>
Subject Re: 1:1 with abstract class
Date Wed, 09 Nov 2005 18:35:32 GMT
Yould use the discriminator tag

On 11/9/05, Hongbo HE <h_he@yahoo.com> wrote:
>
> I have a 1:1 relation of 2 tables. Multiple subClasses
> is mapped to one of them
>
> Order
> (id,
> entityId,
> ...
> )
>
> Entity
> (id,
> type,
> ...
> )
>
> type is the discriminator.
>
> Order {
> long id;
> Entity entity;
> }
>
> abstract Entity {
> long id;
> }
>
> Instructor extends Entity {
> }
>
> Student enxteds Entity {
> }
>
> I'd like to get an order together with its entity
> either Instructor or Student, I can't use the
> dot.notation.to.specify.the.properties, since
> it will try to instantiante an Entity class, which
> is not I wanted.
>
> Any help is greatly appreciated,
>
> Hongbo
>
>
>
> __________________________________
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
>

Mime
View raw message