我有一句SQL,ORACLE数据库,SQL绝对执行正确。。
select t.*,d.class_amount, d.subject_amount from classroom t,
( select fk_classroom,count(*) as ct from examination_room_plan c
where c.fk_number_showings = '402881280f8e8d39010f907ef2b7037c'
group by c.fk_classroom
) a,
examination_room_plan_rule d
where (d.subject_amount - nvl(a.ct,0)) > 0 and t.pk = a.fk_classroom(+)
and t.seat_amount >= d.seat_range_begin and t.seat_amount <= d.seat_range_end
用HQL怎么写?我搞了很久都没有搞定,,高手解决一下,
其中用的表我都有POJO类
classroom Classroom
examination_room_plan ExaminationRoomPlan
examination_room_plan_rule ExaminationRoomPlanRule
|