You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Martin Tilsted <ti...@daimi.au.dk> on 2008/02/09 12:23:45 UTC
Re: Joins to read corresponding rows (ping)
Ping?
Does anyone have an example of a join used to retrieve data? (Or just
some revised documentation :}
Martin
Martin Tilsted wrote:
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org