Empty result set with dynamic query and row handler in iBATIS
Hi,
I'm trying to use the queryWithRowHandler method of iBATIS SqlClientTemplate, but the statement
is returning empty ResultSet and the handleRow method of rowHandler
is not called.
The generated statements are returning at least one row if run manually.
iBatis XML:
Code:
<select id="queryId" parameterClass="map" remapResults="true">
SELECT
<iterate property="fields" conjunction=","> $fields[]$</iterate>, COUNT(1) as pages
FROM aTable
LEFT JOIN otherTable ON (...)
WHERE ...
GROUP BY <iterate property="fields" conjunction=","> $fields[]$</iterate>
</select>
JAVA
Code:
DynamicStatModelRowHandler rowHandler = new DynamicStatModelRowHandler(fields);
getSqlMapClientTemplate().queryWithRowHandler("queryStat", param, rowHandler);
return rowHandler.getStats();
VERSIONS:
Spring Framework 2.5.6, Ibatis 2.3.4.726, Oracle XE 10g
Any help is much appreciated.