[jira] [Updated] (DELTASPIKE-1286) Support save multiple entities

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (DELTASPIKE-1286) Support save multiple entities

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/DELTASPIKE-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Andraschko updated DELTASPIKE-1286:
------------------------------------------
    Fix Version/s:     (was: 1.8.2)

> Support save multiple entities
> ------------------------------
>
>                 Key: DELTASPIKE-1286
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1286
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: Data-Module
>    Affects Versions: 1.7.2, 1.8.0
>            Reporter: Gilberto C Andrade
>            Priority: Minor
>              Labels: jpa
>
> 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
(v7.6.3#76005)