org.hibernate.QueryException: could not resolve property: name of: com.huateng.ebank.entity.data.customer.CustomerInfo [select ci, dd.dataName from com.huateng.ebank.entity.data.customer.CustomerInfo as ci, resource.bean.pub.DataDic as dd where trim(ci.idtype) = trim(dd.dataNo) and dd.dataTypeNo = 29 and ci.custType = '3' and ci.name like ? order by ci.id]
模糊查询时加有条件ci.name,代码移植自db2的系统,现在用oracle,oracle中该字段为cname,而非name,因此造成ci.name无法解析
本文讨论了一个移植自DB2系统的Hibernate查询问题,在Oracle环境下因字段名不匹配导致的查询异常。核心问题是Java实体类属性与Oracle数据库字段名不符,具体表现为查询条件中使用了Java实体类的name属性,而Oracle数据库对应的字段名为cname。
888

被折叠的 条评论
为什么被折叠?



