hibernate-求救啊,Hibernate的问题,查询的时候报错

问题描述

求救啊,Hibernate的问题,查询的时候报错


org.hibernate.QueryException: could not resolve property: user.uuid of: com.chebeiyuan.entity.Usercar
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:67)
at org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:82)
at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:54)
at org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1367)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:457)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:417)
at org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:68)
at org.hibernate.criterion.Junction.toSqlString(Junction.java:82)
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:357)
at org.hibernate.loader.criteria.CriteriaJoinWalker.(CriteriaJoinWalker.java:113)
at org.hibernate.loader.criteria.CriteriaJoinWalker.(CriteriaJoinWalker.java:82)
at org.hibernate.loader.criteria.CriteriaLoader.(CriteriaLoader.java:91)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1578)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
at com.chebeiyuan.dao.impl.CarDaoImpl.findByUserCar(CarDaoImpl.java:25)
at com.chebeiyuan.service.impl.CarServiceImpl.findByUserCar(CarServiceImpl.java:49)
at com.chebeiyuan.action.CarTypeAction.addUserCar(CarTypeAction.java:60)
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 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)

解决方案

设了别名就行了....

解决方案二:

Usercar这个属性没法解析,检查下表和映射。

解决方案三:

map.put("uuid",uuid),别用 user.uuid

时间: 2024-10-03 05:58:48

hibernate-求救啊,Hibernate的问题,查询的时候报错的相关文章

hibernate-新手Hibernate写了个小程序,第一次运行报错如下,好像还有数据库连不上的问题,不知道该怎么改

问题描述 新手Hibernate写了个小程序,第一次运行报错如下,好像还有数据库连不上的问题,不知道该怎么改 九月 07, 2015 10:31:46 下午 org.hibernate.annotations.common.Version INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final} 九月 07, 2015 10:31:46 下午 org.hibernate.Version logVersion INFO: HHH0

c++-ado与数据库连接时成功了,但用参数化查询时却报错unkown error 0x800A0E7D

问题描述 ado与数据库连接时成功了,但用参数化查询时却报错unkown error 0x800A0E7D 数据库用的是server 2005,但在下载时遇到了问题,,后来求助网上,完成后,程序名却叫microsoft sql server studio express,不晓得是不是数据库的问题. 希望大神指点! 以下是我的代码:我在CADOcon定义了_connectionptr指针,所以connection这一部分应该是没问题的.void AddUser::OnOK() { // TODO:

SQL嵌套查询语句的报错问题

问题描述 SQL嵌套查询语句的报错问题 5C String sql = ""select * from msgInfo where ID in(select top 15 ID from msgInfo where chatRoom=? Order by chatTime DESC) order by chatTime""; String userName=session.getAttribute(""_USER"").toS

oracle-ORACLE 触发器中 使用游标查询 本表 报错ORA-04091

问题描述 ORACLE 触发器中 使用游标查询 本表 报错ORA-04091 racle 触发器. 监听表A 更新 更新后触发. 其中 使用游标查询表A 数据. OPEN 游标时 会报 ORA-04091:表A发生了变化,触发器/函数不能读它 于是增加了自定义事物 pragma autonomous_transaction; 增加事物之后不报错了.但是OPEN 的游标 没有获取到任何数据. 想做到的效果是 是这样. 比如说表A里面有4条数据 1 aaaa 2 bbbb 3 cccc 4 dddd

安卓开发 数据库查询的时候报错

问题描述 安卓开发 数据库查询的时候报错 E/AndroidRuntime(25236): java.lang.IllegalStateException: Process 25236 exceeded cursor quota 100, will kill it 解决方案 sqlite的错,是不是你的查询有问题 解决方案二: 看看数据库游标是不是关闭了,是不是在db关闭前关闭了游标cursor

一个hibernate的jap查询无值报错问题!跪求大神回答!

问题描述 问题是这样我在做一个登录功能,用的是jap的EntityManager对象查询.查询语句:{Useruser=(User)em.createQuery("selectenfrom"+getEntityName(this.entityClass)+"asenwhereusName=:nameandusPsword=:pwd").setParameter("name",name).setParameter("pwd",p

求大神们帮帮忙啊,hibernate查询表中的总条数,但是报错

问题描述 这是hibernate查询的代码:这是报的错: 解决方案 解决方案二:count(0)不对,你查出来的list不能转为BigInteger,你要某一字段的值就写字段,count(0)算什么解决方案三:总条数是count(stats.某字段名),然后转为list.get(0)才是你要的,但是query.list强转为BigInteger就不对了,你确定你查出来的是BigInteger对象list吗解决方案四:1.sql语句改下,"selectcount(0)cfromfrom...&qu

在jsp页面中显示lucene的查询结果,报错:org.apache.jasper.JasperException: Java heap space

问题描述 在jsp页面中显示lucene的查询结果,当返回hits的总数小于100时,可以正常显示,当结果大于100,会报如下错误:(但是在java环境下结果输出是正常的)exceptionorg.apache.jasper.JasperException:Javaheapspaceorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:433)org.apache.jasper.

hibernate使用select ifnull报错但是在mysql直接运行没问题

问题描述 hibernate使用select ifnull报错但是在mysql直接运行没问题 String sql = "select ifnull(pushtoken,0) from user where id="+user.getId(); Session session = this.getHibernateTemplate().getSessionFactory() .openSession(); Query q = session.createSQLQuery(sql); L