Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
1.4.1
-
None
-
None
-
JPA
Description
The semantics of Repository is to model a Collection of persistent objects. There is no need to add() an object to a Collection if it is already in that Collection.
By providing save() methods you lead developers to invoke save() on objects which they got from the Repository. This is (usually) inappropriate.
Please provide add() methods to parallel the save() method signatures. Ideally the save() methods would be deprecated.
Even if the save() methods remain, IDE inspections can then be configured to forbid their invocation.