遇到一个sqlmap配置的问题,是不是ibatis的#和$不能混用,或者是别的原因.

为了做一个通用的修改方法,当然表结构也是一样的.
写了如下的sqlmap配置,但是在运行时报了一个Invalid column index的错误,log在sqlmap下面,不知道这里是什么原因,希望有人能帮忙解答一下.
<parameterMap id="editI18nInfoParam" class="map"> 
        <parameter property="tName" javaType="string"/> 
		<parameter property="columnName" javaType="string"/> 
		<parameter property="columnValue" javaType="string"/> 
		<parameter property="locale" javaType="string"/>
		<parameter property="keyColumn" javaType="string"/>
		<parameter property="key" javaType="string"/>
		</parameterMap> 
		<update id="editI18nInfo" parameterMap="editI18nInfoParam">
			<![CDATA[
				update $tName$ set $columnName$=#columnValue# where vclocale=#locale# and $keyColumn$=#key#
			]]>
		</update>

2008-09-29 16:32:23,604 DEBUG [java.sql.Connection] {conn-100085} Connection
2008-09-29 16:32:23,604 DEBUG [java.sql.Connection] {conn-100085} Preparing Statement:          update i18n_p_l_iteminfo set vcdesc=#columnValue# where vclocale=#locale# and vcbasitemcode=#key#       
com.ibatis.dao.client.DaoException: Failed to update - id [editI18nInfo] - parameterObject [{tName=i18n_p_l_iteminfo, columnName=vcdesc, columnValue=<p>aaa</p>, locale=en_US, keyColumn=vcbasitemcode, key=61}].  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in config/properties/sqlmap/bascodeinfo.xml.  
--- The error occurred while applying a parameter map.  
--- Check the bascodeinfo.editI18nInfoParam.  
--- Check the parameter mapping for the 'tName' property.  
--- Cause: java.sql.SQLException: Invalid column index
Caused by: java.sql.SQLException: Invalid column index

你可能感兴趣的:(java,DAO,sql,ibatis,jdbc)