on-internet
← Community

Update List of entities in one query jpa

Stack Overflow ·

I need to update a list of objects in one query. I have class Parent which has a list of Child in ManyToMany relation. I need to update a list of Parent by setting children list to empty(remove all children references from join table). Currently i'm setting children list to empty and updating each entity in a query with a merge action,but when i have a large list of pharmacies there are too many queries. i tried this query: update Parent p set p.children=:children where p in (:parents) where :children is a new HashSet<Child> but it gives me error unexpected end of subtree Is there any way to u

Comments

Sign in or sign up to comment and upvote.

No comments yet.