----- Original Message -----
From: "Marc Lustig" <[EMAIL PROTECTED]>
To: "Turbine Torque Users List" <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 22:39
Subject: AW: torque-performance using cross-references


> Thank you, that helped. So does this code
>
>     Criteria c = new Criteria();
>     c.addJoin(UserItemPeer.ITEM_ID,ItemPeer.ITEM_ID);
>     c.add(UserItemPeer.USER_ID,user);
>     doSelect...
>
> result in that sql:
>
> "SELECT item.* FROM item,user_item WHERE user_item.user_id=x AND
> user_item.item_id=item.item_id"
>

Hi,

You should check your generated BaseUserItemPeer, there should be a
protected method something like doSelectJoinItems(Criteria), make it public
in your UserItemPeer
and use that. This is the most efficent method becuase it will fill up the
Item objects
for each UserItem.

BW,

Andras.

P.S.  I hope a undestood correctly your schema, anyway i think you got the
idea.







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

Reply via email to