RED-6467: Added some debugging information

This commit is contained in:
Viktor Seifert 2023-04-11 14:34:02 +02:00
parent 796cc3c8cc
commit 78fcb0a394

View File

@ -97,12 +97,17 @@ public class EntryPersistenceService {
}
}
@Transactional
public void addEntries(String typeId, Set<String> entries, long version, DictionaryEntryType dictionaryEntryType) {
var type = typeRepository.getById(typeId);
log.info("Adding {} entries to type {}\n", entries, dictionaryEntryType);
log.info("Following entries will be added\n" + String.join("\n", entries));
switch (dictionaryEntryType) {
case ENTRY: {
case ENTRY -> {
var undeletedEntries = entryRepository.undeleteEntries(typeId, entries, version);
undeletedEntries.forEach(entries::remove);
@ -116,9 +121,8 @@ public class EntryPersistenceService {
}).collect(Collectors.toList());
jdbcWriteUtils.saveBatch(entryEntities);
break;
}
case FALSE_POSITIVE: {
case FALSE_POSITIVE -> {
var undeletedEntries = falsePositiveEntryRepository.undeleteEntries(typeId, entries, version);
undeletedEntries.forEach(entries::remove);
@ -131,9 +135,8 @@ public class EntryPersistenceService {
}).collect(Collectors.toList());
jdbcWriteUtils.saveBatch(entryEntities);
break;
}
case FALSE_RECOMMENDATION: {
case FALSE_RECOMMENDATION -> {
var undeletedEntries = falseRecommendationEntryRepository.undeleteEntries(typeId, entries, version);
undeletedEntries.forEach(entries::remove);
@ -146,7 +149,6 @@ public class EntryPersistenceService {
}).collect(Collectors.toList());
jdbcWriteUtils.saveBatch(entryEntities);
break;
}
}
}