感人= = 终于弄好了 String hql="select new Shop(s.strid,s.shopname,s.tradearea,s.discountinfo,s.begintime,s.finishtime) from Shop as s where s.strid in (select strid from Moneythreeshop m where m.strid = s.strid)"; Query query=session.createQuery(hql);…
对于支持子查询的数据库,Hibernate支持在查询中使用子查询.一个子查询必须被圆括号包围起来(经常是SQL聚集函数的圆括号). 甚至相互关联的子查询(引用到外部查询中的别名的子查询)也是允许的. from Cat as fatcat where fatcat.weight > ( select avg(cat.weight) from DomesticCat cat ) from DomesticCat as cat where cat.name = some ( select name.n…