@Test void deleteAllStream() { @SuppressWarnings("unchecked") Stream<Object> entityIds = mock(Stream.class); transactionalRepo.deleteAll(entityIds); verify(transactionManager).getTransaction(any(TransactionDefinition.class)); verify(delegateRepository).deleteAll(entityIds); }
@Override public void deleteAll(Stream<Object> ids) { if (TransactionSynchronizationManager.isSynchronizationActive()) { delegate().deleteAll(ids); } else { createWriteTransactionTemplate() .execute( status -> { delegate().deleteAll(ids); return null; }); } }
TransactionalRepositoryDecorator extends AbstractRepositoryDecorator<E> { @Override public void deleteAll(Stream<Object> ids) { if (TransactionSynchronizationManager.isSynchronizationActive()) { delegate().deleteAll(ids); } else { createWriteTransactionTemplate() .execute( status -> { delegate().deleteAll(ids); return null; }); } } }
TransactionalRepositoryDecorator extends AbstractRepositoryDecorator<E> { @Override public void deleteAll(Stream<Object> ids) { if (TransactionSynchronizationManager.isSynchronizationActive()) { delegate().deleteAll(ids); } else { createWriteTransactionTemplate() .execute( status -> { delegate().deleteAll(ids); return null; }); } } TransactionalRepositoryDecorator(
      Repository<E> delegateRepository, PlatformTransactionManager transactionManager); }
TransactionalRepositoryDecorator extends AbstractRepositoryDecorator<E> { @Override public void deleteAll(Stream<Object> ids) { if (TransactionSynchronizationManager.isSynchronizationActive()) { delegate().deleteAll(ids); } else { createWriteTransactionTemplate() .execute( status -> { delegate().deleteAll(ids); return null; }); } } TransactionalRepositoryDecorator(
      Repository<E> delegateRepository, PlatformTransactionManager transactionManager); @Override void forEachBatched(Consumer<List<E>> consumer, int batchSize); @Override void forEachBatched(Fetch fetch, Consumer<List<E>> consumer, int batchSize); @SuppressWarnings("ConstantConditions") @Override long count(); @SuppressWarnings("ConstantConditions") @Override long count(Query<E> q); @Override Stream<E> findAll(Query<E> q); @Override E findOne(Query<E> q); @Override E findOneById(Object id); @Override E findOneById(Object id, Fetch fetch); @Override Stream<E> findAll(Stream<Object> ids); @Override Stream<E> findAll(Stream<Object> ids, Fetch fetch); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); @Override void update(E entity); @Override void update(Stream<E> entities); @Override void delete(E entity); @Override void delete(Stream<E> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(E entity); @Override Integer add(Stream<E> entities); @SuppressWarnings({"ConstantConditions", "NullableProblems"}) @Override Iterator<E> iterator(); }
TransactionalRepositoryDecorator extends AbstractRepositoryDecorator<E> { @Override public void deleteAll(Stream<Object> ids) { if (TransactionSynchronizationManager.isSynchronizationActive()) { delegate().deleteAll(ids); } else { createWriteTransactionTemplate() .execute( status -> { delegate().deleteAll(ids); return null; }); } } TransactionalRepositoryDecorator(
      Repository<E> delegateRepository, PlatformTransactionManager transactionManager); @Override void forEachBatched(Consumer<List<E>> consumer, int batchSize); @Override void forEachBatched(Fetch fetch, Consumer<List<E>> consumer, int batchSize); @SuppressWarnings("ConstantConditions") @Override long count(); @SuppressWarnings("ConstantConditions") @Override long count(Query<E> q); @Override Stream<E> findAll(Query<E> q); @Override E findOne(Query<E> q); @Override E findOneById(Object id); @Override E findOneById(Object id, Fetch fetch); @Override Stream<E> findAll(Stream<Object> ids); @Override Stream<E> findAll(Stream<Object> ids, Fetch fetch); @Override AggregateResult aggregate(AggregateQuery aggregateQuery); @Override void update(E entity); @Override void update(Stream<E> entities); @Override void delete(E entity); @Override void delete(Stream<E> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); @Override void add(E entity); @Override Integer add(Stream<E> entities); @SuppressWarnings({"ConstantConditions", "NullableProblems"}) @Override Iterator<E> iterator();  }