fix Postgres typing error by casting 2nd operator of like operator to text
This commit is contained in:
@ -14,7 +14,7 @@ public interface HsOfficeContactRepository extends Repository<HsOfficeContactEnt
|
||||
@Query("""
|
||||
SELECT c FROM HsOfficeContactEntity c
|
||||
WHERE :label is null
|
||||
OR c.label like concat(:label, '%')
|
||||
OR c.label like concat(cast(:label as text), '%')
|
||||
""")
|
||||
List<HsOfficeContactEntity> findContactByOptionalLabelLike(String label);
|
||||
|
||||
|
@ -23,11 +23,11 @@ public interface HsOfficeDebitorRepository extends Repository<HsOfficeDebitorEnt
|
||||
JOIN HsOfficePersonEntity person ON person.uuid = partner.person.uuid
|
||||
JOIN HsOfficeContactEntity contact ON contact.uuid = debitor.billingContact.uuid
|
||||
WHERE :name is null
|
||||
OR partner.details.birthName like concat(:name, '%')
|
||||
OR person.tradeName like concat(:name, '%')
|
||||
OR person.familyName like concat(:name, '%')
|
||||
OR person.givenName like concat(:name, '%')
|
||||
OR contact.label like concat(:name, '%')
|
||||
OR partner.details.birthName like concat(cast(:name as text), '%')
|
||||
OR person.tradeName like concat(cast(:name as text), '%')
|
||||
OR person.familyName like concat(cast(:name as text), '%')
|
||||
OR person.givenName like concat(cast(:name as text), '%')
|
||||
OR contact.label like concat(cast(:name as text), '%')
|
||||
""")
|
||||
List<HsOfficeDebitorEntity> findDebitorByOptionalNameLike(String name);
|
||||
|
||||
|
@ -16,11 +16,11 @@ public interface HsOfficePartnerRepository extends Repository<HsOfficePartnerEnt
|
||||
JOIN HsOfficeContactEntity contact ON contact.uuid = partner.contact.uuid
|
||||
JOIN HsOfficePersonEntity person ON person.uuid = partner.person.uuid
|
||||
WHERE :name is null
|
||||
OR partner.details.birthName like concat(:name, '%')
|
||||
OR contact.label like concat(:name, '%')
|
||||
OR person.tradeName like concat(:name, '%')
|
||||
OR person.givenName like concat(:name, '%')
|
||||
OR person.familyName like concat(:name, '%')
|
||||
OR partner.details.birthName like concat(cast(:name as text), '%')
|
||||
OR contact.label like concat(cast(:name as text), '%')
|
||||
OR person.tradeName like concat(cast(:name as text), '%')
|
||||
OR person.givenName like concat(cast(:name as text), '%')
|
||||
OR person.familyName like concat(cast(:name as text), '%')
|
||||
""")
|
||||
List<HsOfficePartnerEntity> findPartnerByOptionalNameLike(String name);
|
||||
|
||||
|
@ -14,9 +14,9 @@ public interface HsOfficePersonRepository extends Repository<HsOfficePersonEntit
|
||||
@Query("""
|
||||
SELECT p FROM HsOfficePersonEntity p
|
||||
WHERE :name is null
|
||||
OR p.tradeName like concat(:name, '%')
|
||||
OR p.givenName like concat(:name, '%')
|
||||
OR p.familyName like concat(:name, '%')
|
||||
OR p.tradeName like concat(cast(:name as text), '%')
|
||||
OR p.givenName like concat(cast(:name as text), '%')
|
||||
OR p.familyName like concat(cast(:name as text), '%')
|
||||
""")
|
||||
List<HsOfficePersonEntity> findPersonByOptionalNameLike(String name);
|
||||
|
||||
|
@ -14,7 +14,7 @@ public interface HsOfficeSepaMandateRepository extends Repository<HsOfficeSepaMa
|
||||
@Query("""
|
||||
SELECT mandate FROM HsOfficeSepaMandateEntity mandate
|
||||
WHERE :iban is null
|
||||
OR mandate.bankAccount.iban like concat(:iban, '%')
|
||||
OR mandate.bankAccount.iban like concat(cast(:iban as text), '%')
|
||||
ORDER BY mandate.bankAccount.iban
|
||||
""")
|
||||
List<HsOfficeSepaMandateEntity> findSepaMandateByOptionalIban(String iban);
|
||||
|
Reference in New Issue
Block a user