Skip to content

Commit

Permalink
Fix persistCopy not working with updateByFilter (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
Idane committed Jun 16, 2021
1 parent 4a1d558 commit d0957cc
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ public <ID extends Serializable, Entity extends BaseCrudEntity<ID>> List<Entity>
HooksDTO<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>> hooks, Boolean persistCopy, DataAccessorDTO accessorDTO) {
List<Entity> finalEntityList = new ArrayList<>();
for(Entity entity : entities) {
if(persistCopy != null && persistCopy) {
entity.saveOrGetCopy();
}

finalEntityList.add(crudUpdateHandlerProxy.updateInternal(entity, hooks, accessorDTO));
}

Expand All @@ -45,7 +41,7 @@ public <ID extends Serializable, Entity extends BaseCrudEntity<ID>> List<Entity>
@Transactional(readOnly = false)
public <ID extends Serializable, Entity extends BaseCrudEntity<ID>> List<Entity> updateByFilterTransactional(DynamicModelFilter filter, Class<Entity> entityClazz,
HooksDTO<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>> hooks, Boolean persistCopy, DataAccessorDTO accessorDTO) {
List<Entity> entities = crudHelper.getEntities(filter, entityClazz, accessorDTO, false, true);
List<Entity> entities = crudHelper.getEntities(filter, entityClazz, accessorDTO, persistCopy, true);
return crudUpdateHandlerProxy.updateManyTransactional(entities, hooks, persistCopy, accessorDTO);
}

Expand Down

0 comments on commit d0957cc

Please sign in to comment.