From b98863ac012aa84a728337847b41bb5f5650613a Mon Sep 17 00:00:00 2001 From: Bogdan Kostov Date: Sat, 8 Jun 2024 18:07:22 +0200 Subject: [PATCH] [Fix kbss-cvut/fta-fmea-ui#352] Fix api for updating fault events - replace fault event supertypes send from client, if any, with managed entities before --- .../analysis/service/FaultEventRepositoryService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/cz/cvut/kbss/analysis/service/FaultEventRepositoryService.java b/src/main/java/cz/cvut/kbss/analysis/service/FaultEventRepositoryService.java index ce3775d..083a1f0 100755 --- a/src/main/java/cz/cvut/kbss/analysis/service/FaultEventRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/analysis/service/FaultEventRepositoryService.java @@ -165,6 +165,14 @@ public void updateChildrenSequence(URI faultEventUri, List childrenSequence log.info("< updateChildrenSequence"); } + @Override + protected void preUpdate(FaultEvent instance) { + if(instance.getSupertypes() != null && !instance.getSupertypes().isEmpty()) + faultEventDao.loadManagedSupertypes(instance); + + super.preUpdate(instance); + } + @Transactional public void update(Rectangle rect){ faultEventDao.update(rect);