make HsOfficeDebitorEntity.partner mandatory
This commit is contained in:
parent
f3360d36bf
commit
70b12bba58
@ -17,7 +17,6 @@ import net.hostsharing.hsadminng.rbac.generator.RbacSpec;
|
|||||||
import net.hostsharing.hsadminng.rbac.generator.RbacSpec.SQL;
|
import net.hostsharing.hsadminng.rbac.generator.RbacSpec.SQL;
|
||||||
import net.hostsharing.hsadminng.repr.Stringify;
|
import net.hostsharing.hsadminng.repr.Stringify;
|
||||||
import net.hostsharing.hsadminng.repr.Stringifyable;
|
import net.hostsharing.hsadminng.repr.Stringifyable;
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
|
||||||
import org.hibernate.annotations.JoinFormula;
|
import org.hibernate.annotations.JoinFormula;
|
||||||
import org.hibernate.annotations.NotFound;
|
import org.hibernate.annotations.NotFound;
|
||||||
import org.hibernate.annotations.NotFoundAction;
|
import org.hibernate.annotations.NotFoundAction;
|
||||||
@ -76,7 +75,6 @@ public class HsOfficeDebitorEntity implements BaseEntity<HsOfficeDebitorEntity>,
|
|||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
|
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
|
||||||
@Version
|
@Version
|
||||||
@ -96,7 +94,7 @@ public class HsOfficeDebitorEntity implements BaseEntity<HsOfficeDebitorEntity>,
|
|||||||
WHERE pRel.holderUuid = dRel.anchorUuid
|
WHERE pRel.holderUuid = dRel.anchorUuid
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
@NotFound(action = NotFoundAction.IGNORE) // TODO.impl: map a simplified raw-PartnerEntity, just for the partner-number
|
@NotFound(action = NotFoundAction.EXCEPTION) // TODO.impl: map a simplified raw-PartnerEntity, just for the partner-number
|
||||||
private HsOfficePartnerRealEntity partner;
|
private HsOfficePartnerRealEntity partner;
|
||||||
|
|
||||||
@Column(name = "debitornumbersuffix", length = 2)
|
@Column(name = "debitornumbersuffix", length = 2)
|
||||||
|
@ -19,7 +19,7 @@ public interface HsOfficeDebitorRepository extends Repository<HsOfficeDebitorEnt
|
|||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
SELECT debitor FROM HsOfficeDebitorEntity debitor
|
SELECT debitor FROM HsOfficeDebitorEntity debitor
|
||||||
JOIN HsOfficePartnerEntity partner
|
JOIN HsOfficePartnerRealEntity partner
|
||||||
ON partner.partnerRel.holder = debitor.debitorRel.anchor
|
ON partner.partnerRel.holder = debitor.debitorRel.anchor
|
||||||
AND partner.partnerRel.type = 'PARTNER' AND debitor.debitorRel.type = 'DEBITOR'
|
AND partner.partnerRel.type = 'PARTNER' AND debitor.debitorRel.type = 'DEBITOR'
|
||||||
WHERE partner.partnerNumber = :partnerNumber
|
WHERE partner.partnerNumber = :partnerNumber
|
||||||
@ -42,7 +42,7 @@ public interface HsOfficeDebitorRepository extends Repository<HsOfficeDebitorEnt
|
|||||||
|
|
||||||
@Query("""
|
@Query("""
|
||||||
SELECT debitor FROM HsOfficeDebitorEntity debitor
|
SELECT debitor FROM HsOfficeDebitorEntity debitor
|
||||||
JOIN HsOfficePartnerEntity partner
|
JOIN HsOfficePartnerRealEntity partner
|
||||||
ON partner.partnerRel.holder = debitor.debitorRel.anchor
|
ON partner.partnerRel.holder = debitor.debitorRel.anchor
|
||||||
AND partner.partnerRel.type = 'PARTNER' AND debitor.debitorRel.type = 'DEBITOR'
|
AND partner.partnerRel.type = 'PARTNER' AND debitor.debitorRel.type = 'DEBITOR'
|
||||||
JOIN HsOfficePersonRealEntity person
|
JOIN HsOfficePersonRealEntity person
|
||||||
|
Loading…
x
Reference in New Issue
Block a user