Advertisement
ronaldkwandy

Untitled

Oct 16th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1.     @Transactional
  2.     public void deleteAll(List<E> entities, String wrapperName) {
  3.         List<E> entitiesToBeDeleted = new ArrayList<E>();
  4.        
  5.         for (E entity : entities) {
  6.             E entityToBeDeleted = mainRepo.getOne(entity.getId());
  7.             entitiesToBeDeleted.add(entityToBeDeleted);
  8.         }
  9.        
  10.         throwMultiBatchError();
  11.        
  12.         if (entitiesToBeDeleted.size() > 0) {
  13.             mainRepo.deleteAll(entitiesToBeDeleted);
  14.             updateRoot(entitiesToBeDeleted.get(0).root());
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement