hibernate吧 关注:2,526贴子:3,003
  • 1回复贴,共1

hibernate 这样的语句怎么改写啊,好像是select count那里错了

只看楼主收藏回复

select new com.school.util.modle.ActivityModel(a.a_id as a_id ,a.a_title as a_title ,a.a_status as a_status,(select count(au.a_id) from ActivityUser au where au.a_id=a.a_id)as count)from Activity a where a.community.c_id="+cId+" order by a.a_status


IP属地:四川1楼2014-05-01 16:09回复
    select new ActivityModel(a.a_id ,a.a_title,a.a_status ,(select count(au.a_id) from ActivityUser au where au.a_id=a.a_id)as count(..) from Activity a where a.community.c_id="+cId+" order by a.a_status,你试试看行不行!


    IP属地:广西4楼2014-05-14 10:02
    回复