Many people like to compare between inverse and cascade, but both are totally different notions (at the bottom of this page).
In Hibernate, only the “relationship owner” should maintain the relationship, and the “inverse” keyword is created to define which side is the owner to maintain the relationship. However the “inverse” keyword itself is not verbose enough.
In few articles, they even suggested that just forget about what is “inverse”, and always put inverse=”true” in the collection variable.
I was going through the link mentioned above but I didn't understand the difference between cascade
and inverse
in Hibernate (at least the sentence in the boldface letter). Could you please explain that difference?
Also seen this question.
In case of many-to-many relation through intermediary table; "Cascade" says whether record will be created/updated in child table. Whereas "Inverse" says whether record will be created/updated in intermediary table
What does it mean "created/updated in intermediarytable"?