报错
org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:219)
at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1310)
at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:396)
at ssh.dao.impl.DiskDAOImpl.updateFileHit(DiskDAOImpl.java:162)
at ssh.dao.impl.DiskDAOImplTest.testUpdateFileHit(DiskDAOImplTest.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'hit' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:210)
... 29 more
代码
@Override
public void updateFileHit(String fileUrl){
getHibernateSession().createSQLQuery("update test_netdisk set hit=hit+1 where fileURL=?").setParameter(0, fileUrl).executeUpdate();
}
原因
不能在原生SQL中写HQL,改表名的同时别忘了改列名,而不是用属性名...
解决
...不说了...掩面泪奔...留个记号
分享到:
相关推荐
could not execute:bad executable format(win32 error 193) 下了一个实现MD5的代码,编译时没有错误,但是执行的时候却提示:could not execute:bad executable format(win32 error 193)
windump工具 大家下着用吧,先装里面的驱动,再在命令行运行
EXECUTE
Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. ...
初学ThinkPHP的时候,很多人都对execute()和query()方法的区别搞不懂,本文就此浅析二者的区别。大家都知道,ThinkPHP中execute()和query()方法都可以在参数里直接输入SQL语句。但是不同的是execute()通常用来执行...
[INFO] ———————————————————————— [INFO] Reactor Summary for demo 0.0.1-SNAPSHOT: [INFO] [INFO] demo ……………………………………….. FAILURE [18:18 min] [INFO] admin-service ...
NVIDIA Tesla V100架构详情介绍。 包括架构、新特性、性能优势!
EVC调试遇到下面问题: ----------------------------------------------------------- Linking... CVTRES : fatal error CVT1102: out of memory; 41 bytes required LINK : fatal error LNK1123: failure during...
文件级别数据库恢复工具软件,本软件适合于操作系统崩溃后将mysql数据目录拷贝出进行恢复,在恢复前需要使用之前备份的数据库结构新建空库,然后将还原文件的数据恢复到新库,目前只能恢复InnoDB引擎、MyISAM引擎 表...
react-naitve 错误之Failed to execute aapt , react-native错误解决方案,
activiti5.21中调用活动(callactivity),在多实例(multi-instance)情况下,子流程无法返回值到主流程,流程完成前直接忽略了子流程变量的处理,所以activiti:out中得不到值 解决方案:将...
1. Instal IP-clamp 1.1, *DO NOT REBOOT* and *DO NOT EXECUTE IT*! 2. Fire our keygen, press Crack and pick Cebas/Ip-clamp dir. (only the public crypto key will be patched) 3. Now you can reboot and ...
本人做系统时遇到的一些Hibernate问题及解决方案。
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 我的SSH项目原本...
SAP Execute Query Directly On The Server 请求文件,通过上下载方式导入
内容概要:本电商系统主要使用ASP.NET技术+BootStrap前端框架+SQLServer数据库,通过对该系统的设计,简化代码实现过程,保留核心功能,可以在实践过程中掌握ASP.NET技术的部分使用方法,如对三层架构开发模式的熟悉...
为了获得较为准确的底板破坏深度预测公式,基于多元回归分析法,结合大量实际资料对底板抗破坏能力、采厚、工作面斜长、采深、岩层倾角这5个与底板破坏深度有直接影响的因子进行线性回归分析,通过比较获得精确度较高的...
Oracle中EXECUTE IMMEDIATE用法
警告: SQL Error: 156, ...org.hibernate.exception.SQLGrammarException: could not execute query org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。 的解决方案。
console.log("Failed to execute query:", error); return } console.log("Query complete!"); database.close(function (error) { if (error) { console.log("Failed to close ...