Do I have to refresh entities after bulk updates / deletes with HQL?
I have written some DAO methods that do bulk updates / deletes with HQL but I see that when the query is executed the entities in memory are not sychronized (the cache is not updated). Say, I have a collection of Projects with a collection of Groups each and I want to delete all Groups. I can iterate the Groups and delete each but I prefer to run a bulk delete with HQL and IN operator. However, the list has the old objects after the query is executed. I realized that I have to refresh the objects with session.refresh(). Is there any other way I can bulk update and update cache automatically?