just a single find method in hs-office-membership repo

This commit is contained in:
Michael Hoennig 2022-10-18 09:14:35 +02:00
parent e6f9484f99
commit 0232ff078d

View File

@ -13,13 +13,12 @@ public interface HsOfficeMembershipRepository extends Repository<HsOfficeMembers
@Query("""
SELECT membership FROM HsOfficeMembershipEntity membership
WHERE :memberNumber is null
OR membership.memberNumber = :memberNumber
WHERE (:memberNumber is null OR membership.memberNumber = :memberNumber)
AND ( CAST(:partnerUuid as org.hibernate.type.UUIDCharType) IS NULL
OR membership.partner.uuid = :partnerUuid )
ORDER BY membership.memberNumber
""")
List<HsOfficeMembershipEntity> findMembershipByOptionalMemberNumber(Integer memberNumber);
List<HsOfficeMembershipEntity> findMembershipsByPartnerUuid(UUID partnerUuid);
List<HsOfficeMembershipEntity> findMembershipsByOptionalPartnerUuidAndOptionalMemberNumber(UUID partnerUuid, Integer memberNumber);
HsOfficeMembershipEntity save(final HsOfficeMembershipEntity entity);