
Mybatis
27号白开水
这个作者很懒,什么都没留下…
展开
-
mybatis报错: Invalid bound statement (not found)
报错信息:ERROR [http-nio-8080-exec-15] 2020-08-05 09:21:01 (GlobalExceptionHandler.java:194) 运行时异常:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jxdinfo.mes.file.dao.TreeFileMapper.deleteFile at org.apache.ibatis.bindi原创 2020-08-05 09:40:18 · 277 阅读 · 0 评论 -
mysql报错:Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in
错误描述:Error updating database.Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :' uuid_filename = ? ', expect IDENTIFIER, actual IDENTIFIER pos 260, line 11, column 35, token IDENTIFIER uuid_file.原创 2020-07-15 08:49:16 · 8799 阅读 · 0 评论 -
Mybatis .xml方式 传入int数值0时,SQL被无视的问题
在做文档管理时,用户可以查询被删除的文档信息,相关file_state = 0,我需要向后台传入数值,查询数据库中file_state = 0的数据。但这个数值被无视了?而我传入file_state = 1 或 2 的时候,是可以查出相应信息的。我的XML文件是这样写的:<if test="file_state != null and file_state != '' and file_state != -1 "> AND file_state = #{file_state}<原创 2020-05-20 16:00:31 · 803 阅读 · 0 评论 -
Mybatis XML文件if test字符串使用问题
一般情况下我们使用.xml方式写条件判断时,系统生成的是<if test = "fuzzy != null and fuzzy != '' ">但在对单个字符串进行比较的时候,用法有所不同:使用单引号包裹<if test = 'fuzzy == "a" '>使用字符串转换<if test = "fuzzy == 'a'.toString()">究其原因,Mybatis是用OGNL表达式来解析的,在OGNL的表达式中,单个字符串如:’x’会被解析原创 2020-05-20 14:36:54 · 1540 阅读 · 0 评论