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

hibernate 能实现同时更新与查询吗
hibernate 能实现同时更新与查询吗 即写一个hql语句 update采用子查询  where条件的结果 是另外一张表查询出来的  例如 update table1 where table1.a=(select table2 from table2 where table2.b='a')
这样可以吗

------解决方案--------------------
可以的,一般都是用子查询查出id
a.id=(select table2.id from table2 where table2.b='a')
这么用