Read the Criteria Howto for Torque. It explains how to perform joins. http://jakarta.apache.org/turbine/torque/criteria-howto.html
You should also read over the Peers Howto. You will find a link to this from the above URL. The Peers Howto should probably be read first. -----Original Message----- From: Eigen Technology Pty Ltd [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 15, 2002 12:30 AM To: [EMAIL PROTECTED] Subject: Join Tables hi, could anyone point me to an document that gives instructions to join tables. I read the documentation that came with TDK, it is a bit unclear ... public Vector doSelectWithCategory (Criteria crit) throws Exception { crit.addJoin (ItemPeer.CATEGORY_ID, CategoryPeer.CATEGORY_ID); addSelectColumns ( criteria ); CategoryPeer.addSelectColumns ( criteria ) // BasePeer returns a Vector of Value (Village) arrays. The array // order follows the order columns were placed in the Select clause. Vector rows = BasePeer.doSelect(criteria); Vector results = new Vector(); // populate the object(s) for ( int i=0; i<rows.size(); i++ ) { Record row = (Record)rows.elementAt(i); MyItem itm = row2Object (row, 1, Class.forName ("com.mycompany.om.MyItem")) MyCategory cat = CategoryPeer.row2Object (row, numColumns+1, Class.forName ("com.mycompany.om.MyCategory")) itm.setCategory (cat); results.add (itm); } return results; } best wishes michael -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
