You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Thomas Andraschko (JIRA)" <ji...@apache.org> on 2018/04/23 12:49:00 UTC
[jira] [Updated] (DELTASPIKE-1286) Support save multiple entities
[ https://issues.apache.org/jira/browse/DELTASPIKE-1286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Andraschko updated DELTASPIKE-1286:
------------------------------------------
Issue Type: Improvement (was: Bug)
> 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)