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
--
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]