在hql中多表关联查询返回VO实体类问题

qq363521369 2015-06-02 09:42:46
String hql = "select new com.lzyim.lm.virtualvo.Viorder(tor.id,tor.deliverytime,tor.replacetype,torde.good.id,torde.goodname,torde.price,torde.amount,tor.sendaddress,tor.company,tor.clientname,tor.totalprice,tor.fee,tor.storestaffname,tor.cardid,tor.remark,tor.orderprinttime,tor.orderstatus,torde.id,tor.client.id,torde.goodtype,torde.goodbrand,torde.tradename,tor.ordertype)from TOrder tor left join tor.orderDetailList  torde left join tor.store tors  where tor.chargeoffstatus=0"


报错
could not resolve property: orderDetailList of: com.lzyim.lm.vo.TOrder [select new com.lzyim.lm.virtualvo.Viorder(tor.id,tor.deliverytime,tor.replacetype,torde.good.id,torde.goodname,torde.price,torde.amount,tor.sendaddress,tor.company,tor.clientname,tor.totalprice,tor.fee,tor.storestaffname,tor.cardid,tor.remark,tor.orderprinttime,tor.orderstatus,torde.id,tor.client.id,torde.goodtype,torde.goodbrand,torde.tradename,tor.ordertype)from com.lzyim.lm.vo.TOrder tor left join tor.orderDetailList  torde left join tor.store tors  where tor.chargeoffstatus=0 and tors.id = ?and tor.ordertype=?and tor.orderstatus=? and tor.createtime>?  and tor.createtime< ?]; nested exception is org.hibernate.QueryException: could not resolve property: orderDetailList of: com.lzyim.lm.vo.TOrder [select new com.lzyim.lm.virtualvo.Viorder(tor.id,tor.deliverytime,tor.replacetype,torde.good.id,torde.goodname,torde.price,torde.amount,tor.sendaddress,tor.company,tor.clientname,tor.totalprice,tor.fee,tor.storestaffname,tor.cardid,tor.remark,tor.orderprinttime,tor.orderstatus,torde.id,tor.client.id,torde.goodtype,torde.goodbrand,torde.tradename,tor.ordertype)from com.lzyim.lm.vo.TOrder tor left join tor.orderDetailList  torde left join tor.store tors  where tor.chargeoffstatus=0 and tors.id = ?and tor.ordertype=?and tor.orderstatus=? and tor.createtime>?  and tor.createtime< ?]


好像原因是tor.orderDetailList没找到,orderDetailList和TOrder是实体类,怎么在实体类里面可以调用到另一个实体类啊?
...全文
452 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
finemi 2015-06-02
  • 打赏
  • 举报
回复
要用完全限定名?
qq363521369 2015-06-02
  • 打赏
  • 举报
回复
引用 1 楼 finemi 的回复:
要用完全限定名?
也不是 特别清楚 呀,那要怎么做呢?

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧