org.hibernate.QueryException: could not resolve property错误的解决方法
2009-10-27 16:16
441 查看
出现这个异常,大多是因为我们在HQL和SQL语句的使用上造成混淆。因为Hibernate使用的是hql语法,而sql语法和它是有区别的。当然了,加入表的字段和映射成hbm.xml文件中属性字段一样的话,就很少发生这样的情况。
比如:ID是表的字段,那么在hbm.xml文件中也是ID,做检索的时候就不能发生问题了。但是,加入我的表的字段是Person_Name,那么在hbm.xml文件中可能就是personName,那么大家在使用字段的时候就的注意,否则就会出现org.hibernate.QueryException: could not resolve 这个异常。
这次在项目在查询时用了qName,一直出错,结果原来是把它映射成QName了。
参考文章:http://blog.sina.com.cn/s/blog_55fc875c01009h4y.html
比如:ID是表的字段,那么在hbm.xml文件中也是ID,做检索的时候就不能发生问题了。但是,加入我的表的字段是Person_Name,那么在hbm.xml文件中可能就是personName,那么大家在使用字段的时候就的注意,否则就会出现org.hibernate.QueryException: could not resolve 这个异常。
这次在项目在查询时用了qName,一直出错,结果原来是把它映射成QName了。
参考文章:http://blog.sina.com.cn/s/blog_55fc875c01009h4y.html
相关文章推荐
- 出现“org.hibernate.QueryException: could not resolve property”错误的解决
- 常见Hibernate报错处理:出现“org.hibernate.QueryException: could not resolve property”和 is not mapped和could not locate named parameter错误的解决
- 异常解决—org.hibernate.QueryException: could not resolve property: “xxx”
- org.hibernate.QueryException: could not resolve property 错误解析
- org.hibernate.QueryException: could not resolve property: address of:
- 数据库异常整理:org.hibernate.QueryException: could not resolve property: “xxx”
- Caused by: org.hibernate.QueryException: could not resolve property
- nested exception is org.hibernate.QueryException:could not resolve property:
- org.hibernate.QueryException: could not resolve property
- Struts Problem Report:org.hibernate.QueryException: could not resolve property: ?? of: com.zyc.xxx
- org.hibernate.QueryException: could not resolve property:
- org.hibernate.QueryException: could not resolve property
- 异常org.hibernate.QueryException: could not resolve property的原因
- Hibernate-org.hibernate.QueryException: could not resolve property: code of:
- org.hibernate.QueryException: could not resolve property
- nested exception is org.hibernate.QueryException: could not resolve property
- org.hibernate.QueryException: could not resolve property:xxxxxid 外键查询 hibernate
- 数据库异常整理:org.hibernate.QueryException: could not resolve property: “xxx”
- org.hibernate.QueryException: could not resolve property:
- 数据库异常整理:org.hibernate.QueryException: could not resolve property: “xxx”