Hql中不能使用下面的删除语法, 但对应sql的语法是正确的。
delete c from Table1 c, Table2 d --ERRORwhere c.refId = d.idand d.contract.id = '001'and d.year=2010
delete c from table1 c, table2 d --CORRECTwhere c.refId = d.idand d.contractId = '001'and d.year=2010
Hql中要用in:
delete c from Table1 c --CORRECTwhere c.refId in (select d.id from Table2 d where d.contract.id = '001' and d.year=2010)