You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Mark Vickers <ma...@yahoo.com> on 2002/02/03 18:08:17 UTC
Problem with addAscendingOrderBy() & addDescendingOrderBy()
Hi folks,
I seem to have encountered a bug surrounding the use
of the order by statement. If I don't add an order by
clause to my criteria, everything works as expected.
When I use the criteria addAscendingOrderByColumn
method, my criteria fails to produce any results.
Here's the code:
crit = new Criteria();
crit.add(QuantitypricePeer.QUANTITY, 0,
Criteria.GREATER_THAN);
System.out.println(crit.toString());
crit.addAscendingOrderByColumn(QuantitypricePeer.QUANTITY);
System.out.println(crit.toString());
And here's the output:
Criteria::
QuantityPrice.QUANTITY<=>(QuantityPrice.QUANTITY>0):
Current Query SQL (may not be complete or applicable):
SELECT FROM QuantityPrice WHERE
(QuantityPrice.QUANTITY>0)
Criteria::
QuantityPrice.QUANTITY<=>(QuantityPrice.QUANTITY>0):
Current Query SQL (may not be complete or applicable):
Executing the following code now generates an
exception:
qPriceVec = product.getQuantityprices(crit);
(Product is a table linked to the quantityPrice table
via a foreign key. I'm using MySQL.)
Any suggestions?
thanks,
mark
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>