FORGE-867 Save JPA entities only on modifications.

A dirty bit is used to track whether the JPA entity is modified or not.
Merge pull request #312 from VineetReynolds/FORGE-867

FORGE-867 Save JPA entities only on modifications.