| 发表于:2008-01-18 10:48:36 楼主 |
from maintaincost m right join fetch m.capitalitem c where m.monthreportid = :id and c.treecode like '00006%' and c.treecode > '00006' order by c.treecode 建立了从maintaincost 到capitalitem 的many-to-one 现在这样只能查出一条记录来,本来是想显示capitalitem 中的所有记录.怎样把这个hql改成和这个sql功能一样的呢 select * from ( select * from maintaincost where monthreportid = 'aaa' ) a right join capitalitem b on a.itemid = b.id where a.treecode like '00006%' and a.treecode > '00006' order by c.treecode |
|
|
|
|