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 Fred Gerson <fr...@wrath.forked.net> on 2003/03/10 09:32:19 UTC
order by column problem
Hey All,
I'm porting an app from Turbine 2.1 to Turbine 2.2 and I'm having trouble
with the Criteria object's addAscendingOrderByColumn() method. I have the
below code that worked fine in 2.1 but now breaks in 2.2
Criteria criteria = new Criteria();
criteria.addAscendingOrderByColumn(AffinityinfoPeer.CYCLE);
criteria.addAscendingOrderByColumn(AffinityinfoPeer.CLIENTNUMBER);
return AffinityinfoPeer.doSelect(criteria);
The doSelect() method above works fine if I comment out the two orderBy
lines above it. The doSelect() method will also work fine if I just do a
criteria.add(column, someValue) with the two columns above and no
ordering. However when I call addAscendingOrderByColumn for some reason
this kills the criteria object - calling toString() on the criteria object
returns a string with no SQL in it. Has anyone else had trouble with this
method in Torque 3.0? Am I overlooking something silly? Please Help.
Thanks,
Fred
Re: order by column problem
Posted by Eric Emminger <er...@ericemminger.com>.
Hi Fred
Could you send the relevant part of your schema? Maybe the column type
is affecting things.
Eric
Fred Gerson wrote:
> Hey Eric,
>
> Thank you very much for your reply. I tried your suggestion below (for
> both the CYCLE and the CLIENTNUMBER columns) but still got the same
> problem.
>
> Any suggestions of where I can start to look to try and debug?
>
> Thanks a lot,
> Fred
>
>
> On Wed, 12 Mar 2003, Eric Emminger wrote:
>
>
>>The addAscendingOrderByColumn() method works for me, although I only use
>>it once on a single Criteria. Does it work for you if you use it just
>>once, as below?
>>
>>Criteria criteria = new Criteria();
>>criteria.addAscendingOrderByColumn(AffinityinfoPeer.CYCLE);
>>//criteria.addAscendingOrderByColumn(AffinityinfoPeer.CLIENTNUMBER);
>>return AffinityinfoPeer.doSelect(criteria);
>>
>>Eric
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
Re: order by column problem
Posted by Fred Gerson <fr...@wrath.forked.net>.
Hey Eric,
Thank you very much for your reply. I tried your suggestion below (for
both the CYCLE and the CLIENTNUMBER columns) but still got the same
problem.
Any suggestions of where I can start to look to try and debug?
Thanks a lot,
Fred
On Wed, 12 Mar 2003, Eric Emminger wrote:
> The addAscendingOrderByColumn() method works for me, although I only use
> it once on a single Criteria. Does it work for you if you use it just
> once, as below?
>
> Criteria criteria = new Criteria();
> criteria.addAscendingOrderByColumn(AffinityinfoPeer.CYCLE);
> //criteria.addAscendingOrderByColumn(AffinityinfoPeer.CLIENTNUMBER);
> return AffinityinfoPeer.doSelect(criteria);
>
> Eric
>
Re: order by column problem
Posted by Eric Emminger <er...@ericemminger.com>.
The addAscendingOrderByColumn() method works for me, although I only use
it once on a single Criteria. Does it work for you if you use it just
once, as below?
Criteria criteria = new Criteria();
criteria.addAscendingOrderByColumn(AffinityinfoPeer.CYCLE);
//criteria.addAscendingOrderByColumn(AffinityinfoPeer.CLIENTNUMBER);
return AffinityinfoPeer.doSelect(criteria);
Eric