Ho usato mybatis-primavera-1.0.3-SNAPSHOT mybatis-3.0.6 spring3.0.6.I tentato di eliminare record da una tabella come questa:Mybatis errori di impostazione dei parametri nulli
<delete id="deleteNote" parameterType="hashMap">
DELETE FROM BBSCS_NOTE
<where>
<if test="ids !=null and ids.length > 0">
<foreach collection="ids" item="id" open="(" close=")" separator=",">
ID IN #{id}
</foreach>
</if>
<if test="toID != null and toID != ''">AND TOID = #{toID}</if>
<if test="fromID != null and fromID != ''">AND FROMID = #{fromID}</if>
<if test="noteType != -1">AND NOTETYPE = #{noteType}</if>
</where>
</delete>
Come hai visto, si tratta di un codice di test sql.The Java dinamico come questo:
Map map = new HashMap();
String ids[] = {"1","2","3"};
map.put("ids", ids);
noteService.del(map);
Quando ho eseguito il codice di prova Java, c'era qualche eccezione in questo modo:
org.springframework.jdbc.UncategorizedSQLException: Error setting null parameter. Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: Invalid column type
; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; Invalid column type; nested exception is java.sql.SQLException: Invalid column type
Wh y? puoi darmi qualche consiglio per risolvere questo problema? Grazie.