"Invalid column name" after second select

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

"Invalid column name" after second select

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" >
                <include refid="columns"/>
                from ${schema}.repo_test
                <include refid="where_causes"/>

<sql id="columns">
                <isNotNull property="columns">
                        <iterate property="columns"  conjunction=','>
                <isNull property="columns">

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

thanks in advance for any help