You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Marc Lustig <ma...@marclustig.com> on 2002/09/21 12:04:35 UTC

quering multiple Peers

Hi,

using queries on Peers it is possible to retrieve data from the
corresponding table.

What if I want to retrieve data from multiple tables at once (somthing like
SELECT k.*,p.* FROM kunden k, produkt p WHERE ...) ?

I couldn't find something in the Peers HowTo.
So how is this commonly solved?
Can I do this with Peers as well?
Or is it necessary to get a connection reference somehow and return to
standard JDBC-functionality?
Another (not very clean) way that I see is to query both Peers and join them
into a single List-object. But as a matter of performance I'd really like to
have a sinlge query for this.

(I'm using Turbine 2.2b3)

Thanks.

Marc




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: quering multiple Peers

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: "Marc Lustig" <ma...@marclustig.com>
> 
> Hi,
> 
> using queries on Peers it is possible to retrieve data from the
> corresponding table.
> 
> What if I want to retrieve data from multiple tables at once (somthing like
> SELECT k.*,p.* FROM kunden k, produkt p WHERE ...) ?
> 
> I couldn't find something in the Peers HowTo.
> So how is this commonly solved?
> Can I do this with Peers as well?
> Or is it necessary to get a connection reference somehow and return to
> standard JDBC-functionality?
> Another (not very clean) way that I see is to query both Peers and join them
> into a single List-object. But as a matter of performance I'd really like to
> have a sinlge query for this.
> 
> (I'm using Turbine 2.2b3)
> 
> Thanks.
> 
> Marc

Provided you have defined the foreign key relationships in your schema then
methods that provide this kind of functionality will be generated for you in
the Base*Peer classes.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>