org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: where near line 1, col
来源:互联网 发布:php微信服务号开发教程 编辑:程序博客网 时间:2024/05/17 08:46
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: where near line 1, column 72
[from cn.itcast.elec.domain.ElecText o where 1=1 and o.textName like ? where o.textRemark like ? order by o.textDate desc, o.textName asc];
nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line 1, column 72
[from cn.itcast.elec.domain.ElecText o where 1=1 and o.textName like ? where o.textRemark like ? order by o.textDate desc, o.textName asc]
报错已很明显,就是hql语句写错了,根据提示,慢慢的找,最后,发现,误把 and 写成 where 了。。
org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: where near line 1, column 72 [from cn.itcast.elec.domain.ElecText o where 1=1 and o.textName like ? where o.textRemark like ? order by o.textDate desc, o.textName asc]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line 1, column 72 [from cn.itcast.elec.domain.ElecText o where 1=1 and o.textName like ? where o.textRemark like ? order by o.textDate desc, o.textName asc] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) at cn.itcast.elec.dao.impl.CommonDaoImpl.findCollectionByConditionNoPage(CommonDaoImpl.java:151) at cn.itcast.elec.service.impl.ElecTextServiceImpl.findCollectionByConditionNoPage(ElecTextServiceImpl.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy9.findCollectionByConditionNoPage(Unknown Source) at junit.TextService.findCollection(TextService.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line 1, column 72 [from cn.itcast.elec.domain.ElecText o where 1=1 and o.textName like ? where o.textRemark like ? order by o.textDate desc, o.textName asc] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1289) at com.sun.proxy.$Proxy11.createQuery(Unknown Source) at cn.itcast.elec.dao.impl.CommonDaoImpl$1.doInHibernate(CommonDaoImpl.java:155) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) ... 38 more
0 0
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: where near line 1, col
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: * near line 1, column
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: 29 near line 1, column
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: xx near line 1, colum
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: 29 near line 1, column
- org.springframework.orm.hibernate3.HibernateQueryException: ClassNotFoundException:
- org.springframework.orm.hibernate3.HibernateQueryException 问题
- SSH org.springframework.orm.hibernate3.HibernateQueryException
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line
- 异常记录:org.springframework.orm.hibernate3.HibernateQueryException:PDIC_USER is not mapped [from PDIC_USER p where 1=1 ]; nested ex
- org.springframework.orm.hibernate3.HibernateQueryException: teacherscore is not mapped
- 十二、org.springframework.orm.hibernate3.HibernateQueryException: Book is not mapped
- org.springframework.orm.hibernate3.HibernateQueryException:表名 is not mapped
- org.springframework.orm.hibernate3.HibernateQueryException: XXX is not mapped
- org.springframework.orm.hibernate3.HibernateQueryException: XXX is not mapped解决方案
- unexpected token: * near line 1, column 8 [select * from t_user where 1=1]
- QuerySyntaxException: unexpected token: user_id near line 1, column 29 [from model.Demand d where d
- 错误提示:org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: *
- 蓝桥杯算法提高—种树问题
- 浅析ATO,MTO和ETO
- cocos2dx lua 加密
- 多个Controller之间的跳转
- HDU 5339-Untitled(dfs)
- org.springframework.orm.hibernate3.HibernateQueryException: unexpected token: where near line 1, col
- 深入理解java虚拟机-3 内存分配与回收策略
- unity 发布flash版本 调试需要flash player debug
- POJ 2503 Babelfish(字典树水题)
- cocos2dx游戏资源加密之XXTEA
- 视频聊天插件:AnyChat使用攻略之iOS开发指南
- 如何给Ubuntu系统清理垃圾
- 括号配对问题
- CANVAS 贝塞尔曲线