I have written the following code to obtain a list of pending orders, joined
with the list of suppliers (to obtain the name of the supplier). But I
cannot get the name of supplier, because I get the recordset from the
OrdersPeer Class, which does not handle columns from other tables than
'orders'.

---
Criteria criteria = new Criteria();
criteria.add(OrdersPeer.IDPRODUCT,Id);
criteria.addJoin(OrdersPeer.IDSUPPLIER,SuppliersPeer.ID);
criteria.addAscendingOrderByColumn(OrdersPeer.ORDERDATE);
return OrdersPeer.doSelect(criteria);
---

How can I obtain the coluns from both tables?

The record of tables are:

orders:
ID,IDPRODUCT,IDSUPPLIER,ORDERDATE,QUANTITY,PRICE

suppliers:
ID,NAME,ADDRESS,PHONE

all the example of joining tables in turbine that I've found, uses joins
only to restrict the resultset, but extracts data from only one of the
tables joined.

T.I.A. Andrea Papotti


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

Reply via email to