Table FOO has a foreign key reference to BAR, so a many-to-one relationship exists.

Foo will contain a getBar() method.  Bar will contain a getFoos(Criteria).  

There are several more methods that can get generated depending on many-to-many
relationships.  So for example if FOO also contains a fk to XXX, then Bar will contain 
a
method getFoosJoinXxx(Criteria).  This method will return a collection of Foos in much 
the
same way as the getFoos method but the Foo's will be prefilled with their related Xxx
objects, so that 

Vector v = getFoos(c);
loop over v
        print v(i).getXxx().getName();
end loop

Vector v = getFoosJoinXxx(c);
loop over v
        print v(i).getXxx().getName();
end loop

will lead to the exact same listing, the second method will use a join to grab all the
data at once.  The first method will have one db access to get the Foo's and then one 
db
hit per getXxx() method.

John McNally

Steve Grant wrote:
> 
> I have the objectModel set to complex in my Torque properties.
> 
> I have the XML in the database schema set up for a foreign key.
> 
> Is that all I have to do?
> 
> What are examples of the join methods that should then emerge in the Peers?
> Its not obvious to me.
> 
> Thanks.
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to