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]>