I know how to join tables in an SQL update but how do I do it in HQL?
Long story: I have items which I process in a run. Each run as an ID and I have a many-to-many relation between items and runs (which is in an extra table).
Now I want to set the state of all items used in a certain run. The naive approach looks like this:
update Items item
set item.statue = :done
where item.state = :new
and :run in item.runs
The last line doesn't work. Hibernate can't turn the bag with runs into something that can be used in a where clause. What's the solution?