这跟原HQL修改一样没什么区别吧!还是你问题再描述清楚一些?

解决方案 »

  1.   

    首先我有一个查询语句:
    hql = "select a from A a,B b where a.id=b.id and a.qq=1 and b.ww=2";
    然后在上面这个查询出来的结果集中做update
    hql = "update A set qq=0 where 上面那个结果";就是把2个语句合并起来。
      

  2.   

    在A表中写一个B的对象,再建立关联关系,建好后请问变成如下:
    update A set qq=0 where b.ww = '2'  //b是B对象名
      

  3.   

    写成子查询的形式应该就可以了吧
    update A set qq='' where A.字段 = (select B.字段 from B where B.字段='')
      

  4.   


    如果像你说的这种情况那我就不用愁了。
    现在的情况就是不建立关联关系,   只有2个表的数据有关联关系。
    如果不建关联关系,那为什么还要用HQL语句?
    直接使用SQL执行不就行?
    update A set qq=0 where a.bid in (
       select b.id from A a,B b where a.id=b.id and a.qq=1 and b.ww=2
    )