ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barnett, Brian W." <brian.barn...@pearson.com>
Subject Execute a changing arbitrary select statement
Date Fri, 16 Sep 2005 14:25:37 GMT
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. 
****************************************************************************

Mime
View raw message