Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-943

Provide add() methods instead of save() methods in EntityRepository

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.4.1
    • None
    • JPA-Module
    • 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.

      Attachments

        Activity

          People

            danielsoro Daniel Cunha
            robinroos2 Robin Roos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: