db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Tilsted <til...@daimi.au.dk>
Subject Joins to read corresponding rows
Date Thu, 24 Jan 2008 18:59:31 GMT
At 
http://db.apache.org/torque/releases/torque-3.3/runtime/reference/read-from-db.html
there is a part called "Joins to read corresponding rows"
I think there is something wrong with that part of the documentation.

I have the following in my schema.xml
    <table name="localePage">
        <column name="id" primaryKey="true" required="true" type="INTEGER"/>
        <column name="name" required="true" size="255" type="VARCHAR"/>
    </table>
    <table name="localePagePart">
        <column name="id" primaryKey="true" required="true" type="INTEGER"/>
        <column name="localePageId" required="true" type="INTEGER"/>
        <column name="name" required="true" size="255" type="VARCHAR"/>
        <foreign-key foreignTable="localePage">
            <reference foreign="id" local="localePageId"/>
        </foreign-key>
    </table>

So a localePage consist of zero of more localePagePart rows, and each 
localePagePart belong to exactly one localePage.

Now according to the documentation, I would expect BaseLocalepagePeer to 
have a protected method called doSelectJoinLocalePagepart but it don't.
It does not have any method starting with doSelectJoin.
But my BaseLocalepagepartPeer do have a doSelectJoinLocalepage.

What I am trying to do is with a single query, to load all localePage 
objects that full fill a criteria, and for each localePage, load all the 
localePagePart objects that belong to that
localePage. (That is: A normal join, like in the example).

Something other is that in the example it try to override the 
|doSelectJoinBooks with a non static method. This does not make any 
sense, because the Peer classes should only contain static methods.|

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message