You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Rafuse <cr...@cs.dal.ca> on 2003/06/12 16:56:23 UTC

Complex Querries with Torque

Hi all, 

I'm developing an application that will user Torque to manipulate a
MYSQL database.It will be using many of the complex SQL constructs:
multi table joins, complex logical conditions in the where statement,
summation of values, etc. Looking at the doSelectTable() methods in the
BaseTablePeer object of my application, I see that much of the join is
performed on the application side, and not on the database side. 

I need to take full advantage of the optimization of the database, so
this doesn't seem like a good option. Is there any other way to join
multiple tables with WHERE conditions then to extend the existing
classes?

Thanks,



Chris


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


Re: Complex Querries with Torque

Posted by Fabio Daprile <fa...@wuerth-phoenix.com>.
hello Chris,

i you need complex queries you can use the criteria objects which are 
provided from torque, or , as Jeffery said the
executeQuery on peer objects. You can extend the Peer classes that 
torque generates to implement your own
search methods.
If you want to take advantage from the ObjectMappingLayer you have to 
accept that the joining is performed on
application side.

Greetings

Fabio Daprile

Jeffery Painter wrote:

>Hi Chris,
>
>I would have to say after using torque for a year now, that it's 
>advantages lie in data persistence and simple lookups. I know mysql does 
>not offer stored procedures, however, you can always use executeQuery() 
>from your peer objects to roll your own sql. This has worked for me when 
>needing to run a complex query which torque just didn't offer an effective 
>solution.
>
>I do believe that joins are performed at the database level though, and 
>the sql generated from the torque objects can be exposed easily enough to 
>see if there are problem areas. I've found the joins I've built with my 
>peer classes to be quite adequate and not require me to use another 
>method.
>
>You can use criteria.toString() to view the actual SQL code that will be 
>sent to the database.
>
>I've heard there are some other persistence layers out there if torque 
>doesn't quite meet your needs. 
>
>HTH,
>Jeff Painter
>
>On 12 Jun 2003, Chris Rafuse wrote:
>
>  
>
>>Hi all, 
>>
>>I'm developing an application that will user Torque to manipulate a
>>MYSQL database.It will be using many of the complex SQL constructs:
>>multi table joins, complex logical conditions in the where statement,
>>summation of values, etc. Looking at the doSelectTable() methods in the
>>BaseTablePeer object of my application, I see that much of the join is
>>performed on the application side, and not on the database side. 
>>
>>I need to take full advantage of the optimization of the database, so
>>this doesn't seem like a good option. Is there any other way to join
>>multiple tables with WHERE conditions then to extend the existing
>>classes?
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>  
>


-- 
************************************
Würth Phoenix S.r.l.
Fabio Daprile

Via Kravogl 4
I-39100 Bolzano
Phone: +39 0471  564111 (direct 564066)
Fax: +39 0471  564122
mailto:fabio.daprile@wuerth-phoenix.com
http:// www.wuerth-phoenix.com
*************************************



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


Re: Complex Querries with Torque

Posted by Pavel Kusch <pa...@icecentric.com>.
village-2.0-dev-20021111.jar

com.workingdogs.village.Record

there are posts on mailing list how to handle Records

With regards,

Pavel Kusch


----- Original Message -----
From: "Chris Rafuse" <cr...@cs.dal.ca>
To: "Turbine User Mailing List" <tu...@jakarta.apache.org>
Sent: Thursday, June 12, 2003 12:02 PM
Subject: Re: Complex Querries with Torque


> Where do I find the Record object ? What package? Its not with torque,
> and I could not find it in jdbc.
>
>
> Chris
>
> On Thu, 2003-06-12 at 12:23, Jeffery Painter wrote:
> > Hi Chris,
> >
> > I would have to say after using torque for a year now, that it's
> > advantages lie in data persistence and simple lookups. I know mysql does
> > not offer stored procedures, however, you can always use executeQuery()
> > from your peer objects to roll your own sql. This has worked for me when
> > needing to run a complex query which torque just didn't offer an
effective
> > solution.
> >
> > I do believe that joins are performed at the database level though, and
> > the sql generated from the torque objects can be exposed easily enough
to
> > see if there are problem areas. I've found the joins I've built with my
> > peer classes to be quite adequate and not require me to use another
> > method.
> >
> > You can use criteria.toString() to view the actual SQL code that will be
> > sent to the database.
> >
> > I've heard there are some other persistence layers out there if torque
> > doesn't quite meet your needs.
> >
> > HTH,
> > Jeff Painter
> >
> > On 12 Jun 2003, Chris Rafuse wrote:
> >
> > > Hi all,
> > >
> > > I'm developing an application that will user Torque to manipulate a
> > > MYSQL database.It will be using many of the complex SQL constructs:
> > > multi table joins, complex logical conditions in the where statement,
> > > summation of values, etc. Looking at the doSelectTable() methods in
the
> > > BaseTablePeer object of my application, I see that much of the join is

> > > performed on the application side, and not on the database side.
> > >
> > > I need to take full advantage of the optimization of the database, so
> > > this doesn't seem like a good option. Is there any other way to join
> > > multiple tables with WHERE conditions then to extend the existing
> > > classes?
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


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


Re: Complex Querries with Torque

Posted by Chris Rafuse <cr...@cs.dal.ca>.
Where do I find the Record object ? What package? Its not with torque,
and I could not find it in jdbc.


Chris

On Thu, 2003-06-12 at 12:23, Jeffery Painter wrote:
> Hi Chris,
> 
> I would have to say after using torque for a year now, that it's 
> advantages lie in data persistence and simple lookups. I know mysql does 
> not offer stored procedures, however, you can always use executeQuery() 
> from your peer objects to roll your own sql. This has worked for me when 
> needing to run a complex query which torque just didn't offer an effective 
> solution.
> 
> I do believe that joins are performed at the database level though, and 
> the sql generated from the torque objects can be exposed easily enough to 
> see if there are problem areas. I've found the joins I've built with my 
> peer classes to be quite adequate and not require me to use another 
> method.
> 
> You can use criteria.toString() to view the actual SQL code that will be 
> sent to the database.
> 
> I've heard there are some other persistence layers out there if torque 
> doesn't quite meet your needs. 
> 
> HTH,
> Jeff Painter
> 
> On 12 Jun 2003, Chris Rafuse wrote:
> 
> > Hi all, 
> > 
> > I'm developing an application that will user Torque to manipulate a
> > MYSQL database.It will be using many of the complex SQL constructs:
> > multi table joins, complex logical conditions in the where statement,
> > summation of values, etc. Looking at the doSelectTable() methods in the
> > BaseTablePeer object of my application, I see that much of the join is
> > performed on the application side, and not on the database side. 
> > 
> > I need to take full advantage of the optimization of the database, so
> > this doesn't seem like a good option. Is there any other way to join
> > multiple tables with WHERE conditions then to extend the existing
> > classes?
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 


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


Re: Complex Querries with Torque

Posted by Jeffery Painter <pa...@kiasoft.com>.
Hi Chris,

I would have to say after using torque for a year now, that it's 
advantages lie in data persistence and simple lookups. I know mysql does 
not offer stored procedures, however, you can always use executeQuery() 
from your peer objects to roll your own sql. This has worked for me when 
needing to run a complex query which torque just didn't offer an effective 
solution.

I do believe that joins are performed at the database level though, and 
the sql generated from the torque objects can be exposed easily enough to 
see if there are problem areas. I've found the joins I've built with my 
peer classes to be quite adequate and not require me to use another 
method.

You can use criteria.toString() to view the actual SQL code that will be 
sent to the database.

I've heard there are some other persistence layers out there if torque 
doesn't quite meet your needs. 

HTH,
Jeff Painter

On 12 Jun 2003, Chris Rafuse wrote:

> Hi all, 
> 
> I'm developing an application that will user Torque to manipulate a
> MYSQL database.It will be using many of the complex SQL constructs:
> multi table joins, complex logical conditions in the where statement,
> summation of values, etc. Looking at the doSelectTable() methods in the
> BaseTablePeer object of my application, I see that much of the join is
> performed on the application side, and not on the database side. 
> 
> I need to take full advantage of the optimization of the database, so
> this doesn't seem like a good option. Is there any other way to join
> multiple tables with WHERE conditions then to extend the existing
> classes?
> 


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