From 94e2dfbe2c10147689b662de1ed496405f8f2824 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 28 Apr 2021 12:00:30 +0400 Subject: [PATCH] #27 -- fix long execution time of removing commits --- src/main/java/ru/ulstu/extractor/service/CommitService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/ru/ulstu/extractor/service/CommitService.java b/src/main/java/ru/ulstu/extractor/service/CommitService.java index 0d7c61c..ed75ee1 100644 --- a/src/main/java/ru/ulstu/extractor/service/CommitService.java +++ b/src/main/java/ru/ulstu/extractor/service/CommitService.java @@ -10,7 +10,6 @@ import org.springframework.stereotype.Service; import ru.ulstu.extractor.model.Commit; import ru.ulstu.extractor.repository.CommitRepository; -import javax.transaction.Transactional; import java.util.List; import java.util.stream.Collectors; @@ -40,9 +39,8 @@ public class CommitService { }).collect(Collectors.toList()); } - @Transactional public void deleteWithEmptyIds() { - commitRepository.deleteByBranchIsNull(); + jdbcTemplate.update("DELETE FROM commit where branch_id is null"); } public void updateBranchId(List commits, Integer branchId) {