select * from cst_inf as ci inner join (select * from crcrd_bsc_inf as cbi where cbi.MAINCRD_CRDID like '%123%') as c on c.CST_ID=ci.CST_ID;上述的sql语句如何转换成HQl语句,上述sql已经跑通了....恳请高人指点
select * from cst_inf as ci inner join (select * from crcrd_bsc_inf as cbi where cbi.MAINCRD_CRDID like '%123%') as c on c.CST_ID=ci.CST_ID;上述的sql语句如何转换成HQl语句,上述sql已经跑通了....恳请高人指点
crcrd_bsc_inf 对象 CrcrdBscInfhsql="
select * from CstInf a ,CrcrdBscInf b
where a.CSTID=b.CSTID and b.MAINCRDCRDID like ?"
list = getHibernateTemplate().find(hsql, '%' + 123+ '%');
123为变量
from cst_inf ci join fetch ci.crcrd_bsc_inf bsc where bsc.MAINCRD_CRDID like '%123%'
where on cbi.CST_ID=ci.CST_ID
and cbi.MAINCRD_CRDID like '%123%'
因为你是iner join