日期:2014-05-20  浏览次数:20945 次

criteria自查询问题
请问高手,这条sql语句怎么用criteria写呀?
select c.id, c.uid,c.chargemoney,c.paymode,a.order_no,a.id,r.id,r.name from 
(select * from charge_record where uid = 3) as c left outer join AlipyPayModel as a on c.id = a.id left outer join RemitPayModel r on c.id = r.id 
where a.state = 1 or r.state = 1

怎么用criteria写子查询呢?

------解决方案--------------------
同求,友情帮顶!
------解决方案--------------------
criteria里也可以写SQL语句的。。。以前同事写过 ,,,,我喜欢hql,,用criteria很少
------解决方案--------------------
criteria 嵌套查询写起来是挺麻烦

要不你直接用SQL查询吧 executeSQLQuery