updating many records (batch update) in hibernate
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
精彩评论