Hibernate what does inverse mean
This is precisely because the sentence c1. Then try the above program again without moving anything. After the execution result, both parties can be inserted correctly, because there is The sentence p.
So why use inverse? Isn't it good to let both parties have control? This raises the issue of efficiency. If there are children, then more updates will be done invisibly. So obviously, this parent-child relationship is easier to maintain by the children. It reduces the burden on the database. Now Child is responsible for maintenance.
Then comment out the sentence and try again. The execution statement is the same after running, but when you look at the table records, you will find that the Parent table can correctly insert the record, and the pid field in the Child table is empty.
This is precisely because the sentence c1. And you commented it again, as the controlling Child has not been set to be associated with the Parent, then the connection between the two tables will disappear, even if there is a sentence of p. Add c1 , the association cannot be achieved , Because p is not in control. So why use inverse? Is it bad to give both parties control? If there are children, then there are additional updates, so obviously, the parent-child relationship is less laborious to maintain by the children.
It reduces the burden on the database. Active 2 years, 8 months ago. Viewed 4k times. Please help Here is my answer Inverse is a an attribute of tag in hibernate. Improve this question. Vlad Mihalcea k 54 54 gold badges silver badges bronze badges. Add a comment.
Active Oldest Votes. You are right with your answer. Improve this answer. Vlad Mihalcea Vlad Mihalcea k 54 54 gold badges silver badges bronze badges. Shailendra Shailendra 7, 2 2 gold badges 23 23 silver badges 35 35 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
0コメント