Inverse is the basic concept in hibernate bidirectional relationship. The real function of inverse is to specify which side to maintain the association between. When a party specifies "Inverse=false" (the default), then that party is responsible for the relationship, and that is how hibernate generates SQL to maintain the associated records!
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/F8/wKioL1XxNEDzJbLNAADqgTUZ3XU730.jpg "title=" 1.png " alt= "Wkiol1xxnedzjblnaadqgtuz3xu730.jpg"/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/F8/wKioL1XxNI-x4_LOAAGfNpNJ_Qc726.jpg "title=" 5.png " alt= "Wkiol1xxni-x4_loaagfnpnj_qc726.jpg"/>
If you set inverse to False, you will print more than one SQL statement
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/F8/wKioL1XxNEuAxqHYAALoFp18cMQ718.jpg "title=" 2.png " alt= "Wkiol1xxneuaxqhyaalofp18cmq718.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M02/72/F8/ Wkiol1xxnfbqvgtuaag018l0wsi199.jpg "title=" 3.png "alt=" Wkiol1xxnfbqvgtuaag018l0wsi199.jpg "/>
If you change the inverse configuration to true then the result will print 2 statements
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/72/FB/wKiom1XxMuOgOSbIAACxCZjLg_c647.jpg "title=" 6.png " alt= "Wkiom1xxmuogosbiaacxczjlg_c647.jpg"/>650) this.width=650; src= http://s3.51cto.com/wyfs02/M01/72/F8/ Wkiol1xxnrirybviaaca8danxn8347.jpg "title=" 7.png "alt=" Wkiol1xxnrirybviaaca8danxn8347.jpg "/>
One-to-many, if you want one side to maintain off
The "one" side of each object that is associated with the "one" object when inserting or deleting "a". And if the "many" aspect of maintaining the relationship there will be no update operation, because the relationship is in the object of the multi-party, directly into the insertion or deletion of multi-party objects on the line
This article is from the "Lao Niu Java" blog, please be sure to keep this source http://liuyj.blog.51cto.com/2340749/1693459
Hibernate inverse effect