Parameter XXX does not exist as a named parameter in[.....]
来源:互联网 发布:2016手游大数据 编辑:程序博客网 时间:2024/06/05 15:06
最近出现了几次类似于Parameter XXX does not exist as a named parameter in[…..]的错误,排查起来也比较痛苦,这里记录下报错的原因:
1.查询条件:
searchCondition.append(" and t.certificateId =: certificateId");
- 1
- 1
这么写就会报错,=:符号必须紧跟后面的变量,需写成:
searchCondition.append(" and t.certificateId=:certificateId");
- 1
- 1
2.查询条件:
searchCondition.append(" and t.logStatus in (:logStatus)");
- 1
- 1
会报错,要写成
searchCondition.append(" and t.logStatus in(:logStatus)");
- 1
- 1
简单来说,就是在写hql的查询语句的时候,没事不要瞎加逗号,尤其是查询条件和值之间,否则hibernate在执行语句的时候就会报错,这点非常重要,在使用charindex函数是使用:x 时,变量值里面有,号是会报这种错误,把逗号改为|就行
阅读全文
0 0
- Parameter XXX does not exist as a named parameter in[.....]
- Positional parameter does not exist: 2 in query
- org.codehaus.xfire.fault.XFireFault: Parameter {http://xxx.xxx}method(方法) does not exist!异常
- does not contain handler parameter named 'method'
- does not contain handler parameter named 'method'
- does not contain handler parameter named
- java.lang.IllegalArgumentException: Positional parameter does not exist: 1 in query解决
- Positional parameter does not exist: 1 in query: from Books where isbn=?
- Type 'System.Web.UI.WebControls.Parameter' does not have a public property named 'DbType'
- does not contain handler parameter named 'method' 异常
- does not contain handler parameter named 'method' 异常
- does not contain handler parameter named 'method'.错误
- does not contain handler parameter named 'method'问题解决
- Parameter xxx not found.
- Parameter Maps collection does not contain value for XXX.map
- mysql:The user specified as a definer ('xxx'@'%') does not exist 解决方法
- does not contain handler parameter named 'method'. This may be caused by whitespace in the label text.异常及其解决方案
- does not contain handler parameter named 'method'. This may be caused by whitespace in the label text
- PHP框架的好坏怎么区
- java 知识点路线图整理(java web/gradle/spring/mybatis/docker/shiro)
- java——类——abstract
- ListView混搭ProgressBar绝佳更新方式
- AndroidStudio系列之Github使用教程
- Parameter XXX does not exist as a named parameter in[.....]
- 安卓通过js与网页的H5页面进行交换
- java——类——interface
- 基于servlet和ajax的聊天室
- elasticsearch
- Android SharedPreferences 多进程访问问题
- Ubuntu mysql
- Queue队列
- 数据结构基础温故-6.查找(上):基本查找与树表查找