thanks Quinton,

I have read the Peers documentation that comes with TDK. The excerpt I
included was from there. However, this Peers doco says that the
subclassing bit is out-of-date.

"Note: some information here is out of date (Subclassing). The Class
Hierarchy document provides more current information regarding mapping a
hierarchy in the OM/Peer system."


And I don't know where to get an up-to-date one. I just realized that by
including the FOREIGN key in the schema will get TDK to include most of
the codes. Now I need an example using Velocity to extract data from a
pair of joined table. There is no such example in the Peers doco.

best wishes
michael








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




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

Reply via email to