A Hibernate tip for many-to-many relationships

I found a very useful explanation why the bridge table for a many-to-many relationship was not saving when I did an insert. The Inside explanation of inverse=true points out that

“The side having inverse=”false” (default value) has this responsibility (and will create the appropriate SQL query - insert, update or delete). Changes made to the association on the side of the inverse=”true” are not persisted in DB.”

Here is some sample code.

Comments are closed.