Pull request #153: RED-2439: Fixed misssing transaction on update textbefore/textafter

Merge in RED/persistence-service from RED-2439-2 to master

* commit '63c43e61339baf3703f9429a8a9406f34e69801c':
  RED-2439: Fixed misssing transaction on update textbefore/textafter
This commit is contained in:
Dominique Eiflaender 2021-12-10 12:52:08 +01:00
commit 777ddcf59d
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());
});
}