move Parter+Debitor person+contact to related Relationsship #20
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user