开发者

updating many records (batch update) in hibernate

开发者 https://www.devze.com 2023-03-23 05:20 出处:网络
I have class A and class B. Now class A has Set of B. class A{ Set<B> bset // } bset.size()can be > 100 or> 500 etc

I have class A and class B. Now class A has Set of B.

class A{
 Set<B> bset //

}

bset.size() can be > 100 or > 500 etc

Now i want to change one filed of all B which corresponds to A

Eg:update B set Bfield = x where id IN (1,2,3);

1)What will be the query in hibernate? 2)1,2,3 ar开发者_开发知识库e ids of B (B.id).

3)How can i retrive all ids of B that corresponds to A in the format required by the query?


If I understood you correct

update B set b.field = :newValue where b.parent = :parentA
0

精彩评论

暂无评论...
验证码 换一张
取 消