tôi đã sử dụng mybatis xuân-1.0.3-SNAPSHOT mybatis-3.0.6 spring3.0.6.I cố gắng để xóa bản ghi từ một bảng như thế này:Mybatis-Lỗi thiết lập tham số rỗng
<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>
Như bạn có nhìn thấy, đó là một sql.The mã kiểm tra java năng động như thế này:
Map map = new HashMap();
String ids[] = {"1","2","3"};
map.put("ids", ids);
noteService.del(map);
Khi tôi thực hiện mã kiểm tra java, đã có một số ngoại lệ như thế này:
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 Bạn có thể cho tôi một số lời khuyên để giải quyết vấn đề này không?