"Invalid column name" after second select

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"Invalid column name" after second select

hajmon
hello
i have app that uses spring+ibatis.
here is my problem.
executing first select everything is ok:
{pstm-100052} Executing Statement:    select                  DATE_COLUMN    ,     NUMBER_COLUMN                from cov1cc.repo_test     where       (     ID_COLUMN = ?    )       

but when i execute second select from same table but other columns:

{pstm-100055} Executing Statement:    select                  TIMESTAMP_COLUMN    ,     VARCHAR_COLUMN                from cov1cc.repo_test     where       (     ID_COLUMN = ?    )     

i have:

--- The error occurred while applying a result map.  
--- Check the selectRepoTest-AutoResultMap.  
--- Check the result mapping for the 'DATE_COLUMN' property.  
--- Cause: java.sql.SQLException: Invalid column name  

at the end of Java code i Execute method

@Transactional(propagation = Propagation.SUPPORTS)
        private Object queryForObject(String name, ParameterClass in) throws SQLException,SqlMapException{
                return sqlMapClient.queryForObject(name, in);
}


and my ibatis xml mapping is:


<select id="selectRepoTest" resultClass="java.util.Properties" parameterClass="ParameterClass" >
                select
                <include refid="columns"/>
                from ${schema}.repo_test
                <include refid="where_causes"/>
</select>

<sql id="columns">
        <dynamic>
                <isNotNull property="columns">
                        <iterate property="columns"  conjunction=','>
                                $columns[]$
                        </iterate>
                </isNotNull>
                <isNull property="columns">
                        *
                </isNull>
        </dynamic>
</sql>

<sql id="where_causes">
        <dynamic prepend="where">
                <isNotNull property="wheres">
                        <iterate property="wheres" open="("  close=")" conjunction='AND'>
                                $wheres[].key$ = #wheres[].value#
                        </iterate>
                </isNotNull>
        </dynamic>
</sql>


thanks in advance for any help
Loading...