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

Support save multiple entities

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.7.2, 1.8.0
    • None
    • Data-Module

    Description

      I see a common pattern appearing in our code that it iterates the list of entities and calls save(S).
      I would like to propose another save method to EntityRepository class:

          public abstract <S extends T> List<S> save(Iterable<S> entities) {
      
              List<S> result = new ArrayList<S>();
      
              if (entities == null) {
                  return result;
              }
      
              for (S entity : entities) {
                  result.add(save(entity));
              }
      
              return result;
          }
      

      I don't know what is the impact on transaction - I've not worked with batch yet.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gilbertoca Gilberto C Andrade
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: