use reload where possible

This commit is contained in:
Michael Hoennig 2025-01-14 15:44:44 +01:00
parent b094f1d8ec
commit 35ddf85269
3 changed files with 3 additions and 3 deletions

View File

@ -179,7 +179,7 @@ public class HsOfficeDebitorController implements HsOfficeDebitorsApi {
context.define(currentSubject, assumedRoles); context.define(currentSubject, assumedRoles);
final var current = debitorRepo.findByUuid(debitorUuid).orElseThrow().load(); final var current = debitorRepo.findByUuid(debitorUuid).orElseThrow().reload(em);
new HsOfficeDebitorEntityPatcher(em, current).apply(body); new HsOfficeDebitorEntityPatcher(em, current).apply(body);

View File

@ -89,7 +89,7 @@ public class HsOfficeDebitorEntity implements BaseEntity<HsOfficeDebitorEntity>,
SELECT DISTINCT partner.uuid SELECT DISTINCT partner.uuid
FROM hs_office.partner partner FROM hs_office.partner partner
JOIN hs_office.relation dRel JOIN hs_office.relation dRel
ON dRel.uuid = debitorreluuid AND dRel.type = 'DEBITOR' ON dRel.uuid = debitorRelUuid AND dRel.type = 'DEBITOR'
JOIN hs_office.relation pRel JOIN hs_office.relation pRel
ON pRel.uuid = partner.partnerRelUuid AND pRel.type = 'PARTNER' ON pRel.uuid = partner.partnerRelUuid AND pRel.type = 'PARTNER'
WHERE pRel.holderUuid = dRel.anchorUuid WHERE pRel.holderUuid = dRel.anchorUuid

View File

@ -803,7 +803,7 @@ class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanu
.vatReverseCharge(false) .vatReverseCharge(false)
.build(); .build();
return debitorRepo.save(newDebitor).load(); return debitorRepo.save(newDebitor).reload(em);
}).assertSuccessful().returnedValue(); }).assertSuccessful().returnedValue();
} }