El Jue 05 Jul 2001 22:58, escribiste:
> on 7/5/01 1:32 PM, "Saimon Moore" <[EMAIL PROTECTED]> wrote:
> >       Criteria criteria = new Criteria();
> >
> >       criteria.add(CDPeer, aCD);
> >       criteria.add(LocationPeer, aLocation);
> >
> >       criteria.addJoin(CDPeer.LOCATION_ID, LocationPeer.LOCATION_ID);
> >
> >       Object o = CDPeer.doInsert(criteria); //Should I use CDPeer with
> > this //or LocationPeer or one for each
>
> To add to what John just said...
>
> You are confusing how SQL works...
>
> You have a Location table and a CD table. Those are represented by the
> Location and CD BO Peer objects.
>
> In order to do a join between the two tables, you need another join table.
> Something like: RLocationCD (english: relate location and cd). That table
> would have a CD_ID column and a LOCATION_ID column.
>
> RLocationCD rlcd = new RLocationCD();
> rlcd.setCDID(id);
> rlcd.setLocationID(id);
> rlcd.save();
>
> -jon

It just shows my lack of understanding of DB-OM in general. I come from 
working with SQL directly and am getting to grips with it through Peers. 
Please bear with me...

Thanks a lot to all...

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to