org.hibernate.QueryParameterException: could not locate named...
其实之前也遇到过这样的问题:
我遇到的是空格:HIbernate查询语句的问题。
例如:String hql = "select m.card_no,cu.name,m.enter_date,m.member_id from member as m ,car as ca,customer as cu ";
String where = " where m.member_id=ca.member_id and m.member_id=cu.member_id";
if(operatorId !=null)
where += " and m.operator_id =:operatorId";
Session session=this.getSession();
try {
Query q= session.createSQLQuery(hql.concat(where).concat(" order by m.card_no desc"));
注意了order by m.card_no desc 语句前的空格,如果没有加空格的话
控制台回报:org.hibernate.QueryParameterException: could not locate named Parameter[operatorId]这样的错误,其实我仔细分析我这里发现是查询语句有问题,我这里是执行了createSQLQuery 如果是createQuery没有加空格也会有这样的错误。在网上搜索了一番,也有别人的遇到这种情况,但是都是细节问题,有的String hql="from Customer c where c.customerStatus= customerStatus"; 这里“= customerStatus”少了“:”应为“= :customerStatus”,还有的干脆没有设置参数 setParamete等等。往往这样的错误很难发现。往往注意细节,对于编程很重要。
分享到:
相关推荐
在windows环境下的eclipse或者idea中编写spark应用时,有时为了验证程序功能需要以本地模式运行...java.io.Exception: Could not locate executable null\bin\winutils.exe in the Hadoop binarie 本文件可以解决此异常
报错:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.-附件资源
## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI ## default is java:comp/UserTransaction ## you do NOT need this setting if you specify hibernate....
解决在BC45上编译ucosii时出现“could not locate:TASM2MSG”问题 可以把TASM2MSG.DLL考到C:\TASM\BIN下,也可以考到程序工程目录下 (C:\SOFTWARE\uCOS-II\EX1_x86L\BC45\SOURCE)
cudart64_110 cufft64_10 cublas64_11 cublasLt64_11 cusolver64_11 curand64_10 cusparse64_11 cudnn64_8等
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:378) at org.apache.hadoop.util.Shell....
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...
安装Qt自动生成的QtMsBuild文件,没有这个文件,调试时会报错 QtMsBuild: could not locate qt.targets, qt.props; project may notbuild correctly
IOS升级后无法真机测试:could not locate device support files解决办法-附件资源
10)..Fixed: "Cannot locate menu item 'HelpThirdPartyMenuItem'" 11)..Fixed: Improved hang detection 12)..Fixed: Crash when creating anonymous thread without EurekaLog active 13)..Changed: New EHash, ...
sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "dlopen(libclntsh.dylib, 1): image not found". See ...
操作系统:Ubuntu 16.04 问题描述: 在终端启动gedit命令或者vscode命令报错:gedit: symbol lookup error: /home/chujie/anaconda3/lib/libgobject-2.0.so.0: undefined symbol: g_date_copy ...locate libgob
Could not locate executable null \bin\winutils.exe in the hadoop binaries 缺少hadoop.dll 错误如下: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
自律成为习惯,优秀自然而然。 发现问题 分析:这种问题的出现主要是我们在window模式环境中开发的时候没有搭建Hadoop和Spark。 解决办法 第一步:找到你的搭建Hadoop配置bin的文件夹 我这里是用一个文件夹专门来...
java.io.IOException: Could not locate executable G:\hadoop-2.6.0\hadoop-2.6.0\bin\winutils.exe in the Hadoop binaries.出现此内容的报错。 适用于在Windows系统本地运行Mapreduce程序,可以挑选接近所选用的...
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.” 缺少Hadoop插件winutils.exe所致。 两种解决方案: 1、下载该文件到D:\hadoop\bin下,并设置环境变量HADOOP_...
里面包含hibernate所需的所有必须包,令附MySql驱动包和一个Hibernate Hellword程序,下载后便可导入包,引入程序运行,myeclipse 连接mysql数据库
Windows安装启动盘EFI\boot\目录下的bootx64.efi文件