读书人

hibernate 会实现同时更新与查询吗

发布时间: 2014-01-08 00:30:58 作者: rapoo

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')
这么用

读书人网 >J2SE开发

热点推荐