In the topic "Inside explanation of inverse=true"
I have found rather cryptic note in the "update" section:
Quote:
Will do the following SQL queries
Hibernate: select parent0_.id as id from parent parent0_ where parent0_.id=? //get parent 1
Hibernate: select parent0_.id as id from parent parent0_ where parent0_.id=? //get parent 2
Hibernate: select child0_.id as id, child0_.parent_id as parent_id from child child0_ where (child0_.parent_id=? ) //get children of parent 1
Hibernate: select child0_.id as id__, child0_.id as id, child0_.parent_id as parent_id from child child0_ where child0_.parent_id=?
Hibernate: select child0_.id as id__, child0_.id as id, child0_.parent_id as parent_id from child child0_ where child0_.parent_id=?
//load childrens of Parent 1 and 2 (can't avoid this with set, see FAQ)
Hibernate: update child set parent_id=? where id=?
I have searched all FAQ I could find but never found an explanation or elaboration
on this note. (Was I looking in wrong places?) This is exactly behavior I have see in the application I am working on.
It affects application in a very bad way as we have over 70 of these selects issued and
what is a real killer - database they go to is remote, located in Europe.
I would like to know why this happens and how to get rid of these.
Any explanation or pointers to relevant info will be greatly appreciated.
Thanks.