Like Steve I too am trying to get joins to work. I don't know if Steve
eventually did. I've tried what has been suggested in this thread but still
no joy. I know I am probably doing something stupid as other people have
got all the code generated so as anyone got any suggestions.
I have the following code in my
tdk\webapps\mytest\WEB-INF\build\project\mytest-schema.xml file
<app-data>
<database>
<table name="STATUS">
<column name="STATUSID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
<column name="STATUSDESCRIPTION" size="100" type="VARCHAR"/>
</table>
<table name="WISH">
<column name="WISHID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
<column name="TITLE" size="100" type="VARCHAR"/>
<column name="DESCRIPTION" type="LONGVARCHAR"/>
<column name="SPONSOR" size="100" type="VARCHAR"/>
<column name="ASSIGNED" size="100" type="VARCHAR"/>
<column name="STATUS" type="INTEGER"/>
<foreign-key foreignTable="STATUS">
<reference local="STATUS" foreign="STATUSID"/>
</foreign-key>
</table>
</database>
</app-data>
I run:
tdk\webapps\mytest\WEB-INF\build\build-project project-om
to generate the peer classes.
I have set objectModelType=complex in my
tdk\webapps\mytest\WEB-INF\build\bin\torque\config\torque.props.
Still no joy. My peer and map classes don't seem to have anything to do
with joins in them.
I have tried both tdk1a10 and tdk1a11 and no joy.
Just one thing that puzzles me is that my torque.props for tdk1a10 is in my
WEB-INF\build\bin\torque\config directory. I don't know if this is correct?
In tdk1a11 I don't have a torque.props at all.
If anyone can shed any light on why my joins are not working I would much
appreciate it.
Thanks
Shaun Campbell
-----Original Message-----
From: Steve Grant [mailto:[EMAIL PROTECTED]]
Sent: 16 February 2001 21:16
To: Turbine
Subject: RE: One more Peer/Join question
Whats wrong with this XML? When set the Object model to complex I get no
methods in either the item or category peer classes that refer to the
other - like a getItemsJoinXxx(Criteria).
<database>
<table name="ITEM">
<column name="ITEM_ID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
<column name="TITLE" size="255" type="VARCHAR"/>
<column name="TEXT" size="255" type="VARCHAR"/>
<column name="AUTHOR" size="255" type="VARCHAR"/>
<column name="DEPT" size="255" type="VARCHAR"/>
<column name="URL" size="255" type="VARCHAR"/>
<column name="CATEGORY_ID" required="true" type="INTEGER"/>
<foreign-key foreignTable="CATEGORY">
<reference local="CATEGORY_ID" foreign="CATEGORY_ID"/>
</foreign-key>
</table>
<table name="CATEGORY">
<column name="CATEGORY_ID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
<column name="BODY" size="255" type="VARCHAR"/>
<foreign-key foreignTable="ITEM">
<reference local="CATEGORY_ID" foreign="CATEGORY_ID"/>
</foreign-key>
</table>
</database>
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of John McNally
Sent: Thursday, February 15, 2001 1:45 PM
To: Turbine
Subject: Re: One more Peer/Join question
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]
------------------------------------------------------------
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]