Gilberto C Andrade created DELTASPIKE-1286:
----------------------------------------------

             Summary: Support save multiple entities
                 Key: DELTASPIKE-1286
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1286
             Project: DeltaSpike
          Issue Type: Bug
          Components: Data-Module
    Affects Versions: 1.8.0, 1.7.2
            Reporter: Gilberto C Andrade
            Priority: Minor
             Fix For: 1.8.1


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:
{code:java}
    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;
    }
{code}
I don't know what is the impact on transaction - I've not worked with batch yet.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to