My favorites | Sign in
Project Home Downloads Issues Source
Project Information
Members
Links

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 of primarily focusing in business logic implementation.

It would be nice for the persistence provider or some other utility library to take care of the wirings and re-wirings of the entity reference relationships and let the developer to focus on the business logic.

Most importantly, by moving away this responsibility from the developer, you’re moving away the potential of introducing bugs and inconsistencies in your code.

JpaToolbox is just the library that does the above. This simple lightweight library came out as a by-product the first time I encountered the situation to manually take care of the entity relationships. I have been using it since in my projects; hope you will too find it useful.

Documentation

Sample Project

For a complete sample and startup project please refer to the usage & sample project.

Powered by Google Project Hosting