Author: arminw
Date: Mon Oct 2 17:07:18 2006
New Revision: 452276
URL: http://svn.apache.org/viewvc?view=rev&rev=452276
Log:
fix bug, when GROUP BY is used we have to summarize all count(*) rows
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
URL:
http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java?view=diff&rev=452276&r1=452275&r2=452276
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
Mon Oct 2 17:07:18 2006
@@ -599,14 +599,20 @@
try
{
- if (rsStmt.m_rs.next())
+ /*
+ arminw: if GROUP BY was used in query statement, the result will
be a bunch
+ of single rows. Seems we can't remove GROUP BY from query, because
in
+ BrokerHelper().getReportQueryByCriteriaCount there is a note that
this
+ can't be removed. Thus we have to summarize all count(*) rows
+ */
+ while (rsStmt.m_rs.next())
{
- count = rsStmt.m_rs.getInt(1);
+ count += rsStmt.m_rs.getInt(1);
}
}
catch (SQLException e)
{
- throw new PersistenceBrokerException(e);
+ throw new PersistenceBrokerSQLException(e);
}
finally
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]