RED-2439: Fixed misssing transaction on update textbefore/textafter

This commit is contained in:
deiflaender 2021-12-10 12:42:36 +01:00
parent 01aebdd8f2
commit 63c43e6133
2 changed files with 7 additions and 2 deletions

View File

@ -41,6 +41,12 @@ public class AddRedactionPersistenceService {
}
@Transactional
public void updateSurroundingText(AnnotationEntityId id, String textBefore, String textAfter){
manualRedactionRepository.updateSurroundingText(id, textBefore, textAfter);
}
private List<RectangleEntity> convert(List<Rectangle> positions) {
List<RectangleEntity> rectangleEntities = new ArrayList<>();

View File

@ -52,7 +52,6 @@ public class ManualRedactionService {
private final AnalysisFlagsCalculationService analysisFlagsCalculationService;
private final StopwordService stopwordService;
private final RedactionClient redactionClient;
private final ManualRedactionRepository manualRedactionRepository;
private final HashFunction hashFunction = Hashing.murmur3_128();
@ -108,7 +107,7 @@ public class ManualRedactionService {
var withSurroundingText = redactionClient.addSurroundingText(dossierId, fileId, manualRedactions);
if(withSurroundingText != null) {
withSurroundingText.getEntriesToAdd().forEach(e -> {
manualRedactionRepository.updateSurroundingText(new AnnotationEntityId(annotationId, fileId), e.getTextBefore(), e
addRedactionPersistenceService.updateSurroundingText(new AnnotationEntityId(annotationId, fileId), e.getTextBefore(), e
.getTextAfter());
});
}