move Parter+Debitor person+contact to related Relationsship #20

Merged
hsh-michaelhoennig merged 101 commits from remove-direct-partner-person-and-contact into master 2024-03-28 12:15:14 +01:00
Showing only changes of commit 36d96b543a - Show all commits

View File

@ -55,14 +55,13 @@ public class HsOfficeDebitorEntity implements HasUuid, Stringifyable {
@ManyToOne
@JoinFormula(
referencedColumnName = "uuid",
// FIXME: use _rv in sub-query
value = """
(
SELECT DISTINCT partner.uuid
FROM hs_office_partner partner
JOIN hs_office_relation dRel
FROM hs_office_partner_rv partner
JOIN hs_office_relation_rv dRel
ON dRel.uuid = debitorreluuid AND dRel.type = 'DEBITOR'
JOIN hs_office_relation pRel
JOIN hs_office_relation_rv pRel
ON pRel.uuid = partner.partnerRelUuid AND pRel.type = 'PARTNER'
WHERE pRel.holderUuid = dRel.anchorUuid
)