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等等。往往这样的错误很难发现。往往注意细节,对于编程很重要。
分享到:
相关推荐
报错:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.-附件资源
在windows环境下的eclipse或者idea中编写spark应用时,有时为了验证程序功能需要以本地模式运行...java.io.Exception: Could not locate executable null\bin\winutils.exe in the Hadoop binarie 本文件可以解决此异常
## 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....
该文件能够解决bug:Could not locate zlibwapi.dll. Please make sure it is in your library path!遇到这个bug可以通过下载该文件解决,具体教程见博主的博客。相信很多深度学习小白都遇到了这个bug,快来下载解决...
development/build/sdk.atree:229: couldn't locate source file: framework/layoutlib-tests.jar development/build/sdk.atree:230: couldn't locate source file: system/app/ConnectivityTest.apk development...
cudart64_110 cufft64_10 cublas64_11 cublasLt64_11 cusolver64_11 curand64_10 cusparse64_11 cudnn64_8等
解决在BC45上编译ucosii时出现“could not locate:TASM2MSG”问题 可以把TASM2MSG.DLL考到C:\TASM\BIN下,也可以考到程序工程目录下 (C:\SOFTWARE\uCOS-II\EX1_x86L\BC45\SOURCE)
util.Shell (Shell.java:(694)) - Did not find ...java.io.FileNotFoundException: Could not locate Hadoop executable: E:\hadoop-3.0.2\bin\winutils.exe -see https://wiki.apache.org/hadoop/WindowsProblems
RxJava是一种用于Java虚拟机(JVM)的开源库,它是Reactive Extensions(Rx)的实现,主要用于构建异步和事件驱动的程序。这个库引入了一种新的编程模型,即"反应式编程",它允许开发者以声明式的方式处理数据流和...
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]: ...
"hibernate所需要的所有jar包" 指的是为了在Java开发环境中配置和使用Hibernate ORM框架,需要的一系列依赖库文件。这些jar包包含了Hibernate框架的核心组件和其他必要的支持库,如数据库驱动等。 **描述详解:** ...
安装Qt自动生成的QtMsBuild文件,没有这个文件,调试时会报错 QtMsBuild: could not locate qt.targets, qt.props; project may notbuild correctly
java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.” 缺少Hadoop插件winutils.exe所致。 两种解决方案: 1、下载该文件到D:\hadoop\bin下,并设置环境变量HADOOP_...
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, ...
通过使用`locate`命令,我们发现两个不同的libgobject-2.0.so.0版本存在于系统中:一个位于/home/chujie/anaconda3/lib(版本0.5600.1),另一个在/usr/lib/x86_64-linux-gnu/(版本0.4800.2)。由于gedit试图使用/...
如果出现如下bug:“Could not locate executable null\bin\winutils.exe in the Hadoop binaries”,则下载该文件,放入hadoop的bin文件夹下,并设置环境变量HADOOP_HOME:F:\hadoop2.7.x即可。
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