I just came across the same problem. Another solution is to simply
alias the names of the dynamically generated columns. The aliases
should not be dynamically generated.
So,
<select id="FetchColumnValue"
resultClass="java.lang.Long"
parameterClass="java.lang.String">
select column$columnNameSuffix$ from testtable
</select>
will result in the same unrecognized column error.
It could be changed to
<select id="FetchColumnValue"
resultClass="java.lang.Long"
parameterClass="java.lang.String">
select column$columnNameSuffix$ as columnAlias from testtable
</select>
and work as expected without having to set the remapResults attribute to "true".
Atif Faridi