资 源 简 介
About
If you have worked with persistence in Java, and the chances are very high that you have worked, you probably know that it is the responsibility of the developer to manually take care of the bidirectional relationships between the entities.
As the JPA specification mandates:
It is the developer’s responsibility to keep the in-memory references held on the owning side and those held on the inverse side consistent with each other when they change.
Furthermore:
It is particularly important to ensure that changes to the inverse side of a relationship result in appropriate updates on the owning side, so as to ensure the changes are not lost when they are synchronized to the database.
The above means that the developer will need to handle and update the references between the entities himself, instead o