Criteria c = new Criteria();
c.addJoin(CategoryPeer.STATUS, ItemPeer.STATUS);
List l = CategoryPeer.doSelect(c);

for (Iterator i = l.iterator(); i.hasNext();)
{
  Category c = (Category) i.next();
  c.getCategoryId();
  c.getItem().getItemId();
  ...
}

Or something close to that.

- Stephen


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 10, 2002 2:05 PM
> To: [EMAIL PROTECTED]
> Subject: Select from multiple tables
> 
> Hi,
> Can anyone show me how I can select from multiple database tables?
> 
> for example:
> 
> String sql = "select category.category_id, item.item_id from category
,
> item where category.status=item.status"
> 
> How do I represent the above sql into Criteria object? Is it possible
to do
> this?
> 
> thanks
> Tanay
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-torque-user-
> [EMAIL PROTECTED]>


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

Reply via email to