omnifaces / omnipersistence

Utilities for JPA, JDBC and DataSources
Other
31 stars 12 forks source link

Add ability to operate on collections #6

Closed mydeadlyvenoms closed 6 years ago

mydeadlyvenoms commented 6 years ago

Hi there

It would be nice to have the following methods provided by the BaseEntityService:

public List<I> persist(List<E> entities) 
public List<E> update(List<E> entities)
public List<E> save(List<E> entities)
public void reset(List<E> entities)
public void delete(List<E> entities)

Are there any arguments against this feature I might miss? I usually add them to a CustomBaseEntityService.

BalusC commented 6 years ago

For update and delete it would certainly be useful. I'm not sure about others.

arjantijms commented 6 years ago

@BalusC didn't we had those in the DF version of the entity service as well? I remember them being extra useful with an option for batching, such as when using @janbeernink 's batcher.

I think we had something like delete(List<E> list, int batchSize) back then.

arjantijms commented 6 years ago

As @janbeernink mentioned, supporting Iterable instead of List also has the advantage of not necessarily having to populate a list eagerly.