And Inverse are the basic concepts in hibernate bidirectional relationships. The true role of inverse is to specify which Party maintains the association. If "inverse = false" is specified in one Party (default), that party is responsible for the relationship between them, to put it bluntly, how does hibernate generate SQL statements to maintain the associated records? Hibernate only updates the database synchronously according to the state changes of the master control object. According to the original ing file, people. getAddresses (). add (address), that is, the status of the master control object has changed, so the database will update the database along with the changes in the object status; and address. setPeople (people), that is, the state of the object to be prosecuted has changed. It cannot trigger the simultaneous update of the object and the database. (Instance 1): the simplest one-to-many parent-child relationship. The code is written as follows: parent relationship ing {set name = "children" lazy = "true" inverse = "true"} {key column = "parent_id"/} {one-to-learn class =" test. child "/} {/set} son link ing {parent-to-one name =" Parent "column =" parent_id "not-null =" true "/} parent p = new Parent (); child c = new Child (); c. setParent (p); // maintain the relationship between parent and child p. getChildren (). add (c); session. save (p); session. flush (); Note: {failed-to-one} is always set to "inverse = false", and this attribute does not exist in Mapping! The running result is: Hibernate: insert into parent (id) values (?) Hibernate: insert into child (parent_id, id) values (?, ?) If c. setParent (p) is commented out, the result is: Hibernate: insert into parent (id) values (?) ========================================================== ============= (Instance 2): one Person can participate in multiple events, and one Event has multiple persons. The ing file is as follows: <! -- Person. hbm. xml -->