Add remapResults="true" to the select tag:

<select id="executeArbitraryQuery" parameterClass="java.util.HashMap"
resultClass="java.util.HashMap" remapResults="true">
  $paramQuery$
</select>

Larry


On 9/16/05, Barnett, Brian W. <[EMAIL PROTECTED]> wrote:
>  
> How do you execute an arbitrary select statement that will change using just
> one <select>? Here is what I have: 
>   
> <select id="executeArbitraryQuery" parameterClass="java.util.HashMap"
> resultClass="java.util.HashMap">
>   $paramQuery$
> </select>
>  
> The parameter HashMap just has the one "paramQuery" entry in it. This works
> the first time a select statement is run, but when I change the select
> statement I get an error like this: 
>   
> com.scholar.exception.ServiceException: Error executing sql
> statement. Cause: com.ibatis.dao.client.DaoException: Error
> executing query for list.  Cause:
> com.ibatis.common.jdbc.exception.NestedSQLException:   
> --- The error occurred in
> com/scholar/model/map/GenericSQL.xml.  
> --- The error occurred while applying a result map.  
> --- Check the executeArbitraryQuery-AutoResultMap.  
> --- Check the result mapping for the 'id' property.  
> --- Cause: java.sql.SQLException: Invalid column name id.
> Caused by: java.sql.SQLException: Invalid column name id. 
>   
> The "id" column that it is complaining about is a column from the previous
> select statement. 
>   
> Brian Barnett 
> 
> ****************************************************************************
> 
> This email may contain confidential 
> material. If you were not an intended recipient, 
> Please notify the sender and delete all copies. 
> We may monitor email to and from our network. 
> 
> ***************************************************************************
>

Reply via email to