db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andras Balogh" <and...@reea.net>
Subject Re: torque-performance using cross-references
Date Tue, 21 Jan 2003 07:52:05 GMT

----- Original Message -----
From: "Marc Lustig" <mail@marclustig.com>
To: "Turbine Torque Users List" <turbine-torque-user@jakarta.apache.org>
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.







Mime
View raw message