<select ... remapResults="true"> Larry
On 10/11/05, KwonNam Son <[EMAIL PROTECTED]> wrote: > I think iBatis resue BasicResultMap object even though the select > query's columns are generated dinamically. > > I use <iterate> for SELECT. > It's like the following. > ---------------- > <select id="ad_calstatis_ctstatis_Contract_Cts" > parameterClass="java.util.Map" resultClass="java.util.HashMap"> > SELECT C0, <iterate property="p_mm_array" conjunction=", > ">$p_mm_array[]$</iterate>, TOTAL, COUNT, CODE , FLOOR(OWNER_PART) > OWNER_PART, CONTRACR_GUBN > FROM( ..... blah........ blah........ > blah........ blah... > > ---------------- > $p_mm_array$ is dynamic. > I could be C1, C2 or C1, C2, C3, C4 ... > > I ran a query which has $p_mm_array$ of C1 to C5 > And after I ran a query which has $p_mm_array$ of C1 to C3. > Then I got the following error message. > -------------- > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in mlb/db/ad_calstatis_ctstatis.xml. > --- The error occurred while applying a result map. > --- Check the ad_calstatis_ctstatis_Contract_Cts-AutoResultMap. > --- Check the result mapping for the 'C4_1' property. > -------------- > > I checked the iBatis's PreparedStatement query Log but it was ok. > > So I download iBatis sources and debugged iBatis SQLMap, > then I found the BasicResultMap object of the second query(C1 to C3) > has C1 to C5!!! > > THE BasicResultMap OBJECT IS REUSED even though the select query's > columns are dynamically generated!! > > I use Spring 1.2.5 and iBatis 2.1.5 build 582. > > Can I make iBatis NOT TO REUSE the BasicResultMap object?? > > Thanks. >
