From 378e1ec5849aa319d5dd1d4fc6f7f9efe2dc67d9 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 4 Jan 2024 08:43:22 +0100 Subject: [PATCH] fix Postgres typing error by casting 2nd operator of like operator to text --- .../hs/office/contact/HsOfficeContactRepository.java | 2 +- .../hs/office/debitor/HsOfficeDebitorRepository.java | 10 +++++----- .../hs/office/partner/HsOfficePartnerRepository.java | 10 +++++----- .../hs/office/person/HsOfficePersonRepository.java | 6 +++--- .../sepamandate/HsOfficeSepaMandateRepository.java | 2 +- .../hsadminng/rbac/rbacuser/RbacUserRepository.java | 2 +- .../hsadminng/test/cust/TestCustomerRepository.java | 2 +- .../hsadminng/test/pac/TestPackageRepository.java | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepository.java index a39acbfa..309c3a57 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/contact/HsOfficeContactRepository.java @@ -14,7 +14,7 @@ public interface HsOfficeContactRepository extends Repository findContactByOptionalLabelLike(String label); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java index 617ec09d..f0013ef9 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/debitor/HsOfficeDebitorRepository.java @@ -23,11 +23,11 @@ public interface HsOfficeDebitorRepository extends Repository findDebitorByOptionalNameLike(String name); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java index 4641675a..6c7a158c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/partner/HsOfficePartnerRepository.java @@ -16,11 +16,11 @@ public interface HsOfficePartnerRepository extends Repository findPartnerByOptionalNameLike(String name); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java index 538ffaf1..f7481339 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonRepository.java @@ -14,9 +14,9 @@ public interface HsOfficePersonRepository extends Repository findPersonByOptionalNameLike(String name); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepository.java index d243a716..aab53bae 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateRepository.java @@ -14,7 +14,7 @@ public interface HsOfficeSepaMandateRepository extends Repository findSepaMandateByOptionalIban(String iban); diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepository.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepository.java index bfe11a19..0c1a168b 100644 --- a/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacuser/RbacUserRepository.java @@ -11,7 +11,7 @@ public interface RbacUserRepository extends Repository { @Query(""" select u from RbacUserEntity u - where :userName is null or u.name like concat(:userName, '%') + where :userName is null or u.name like concat(cast(:userName as text), '%') order by u.name """) List findByOptionalNameLike(String userName); diff --git a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerRepository.java b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerRepository.java index a882b304..2dc298ea 100644 --- a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerRepository.java @@ -12,7 +12,7 @@ public interface TestCustomerRepository extends Repository findByUuid(UUID id); - @Query("SELECT c FROM TestCustomerEntity c WHERE :prefix is null or c.prefix like concat(:prefix, '%')") + @Query("SELECT c FROM TestCustomerEntity c WHERE :prefix is null or c.prefix like concat(cast(:prefix as text), '%')") List findCustomerByOptionalPrefixLike(String prefix); TestCustomerEntity save(final TestCustomerEntity entity); diff --git a/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageRepository.java b/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageRepository.java index 610d8fdc..f8538465 100644 --- a/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/test/pac/TestPackageRepository.java @@ -8,7 +8,7 @@ import java.util.UUID; public interface TestPackageRepository extends Repository { - @Query("SELECT p FROM TestPackageEntity p WHERE :name is null or p.name like concat(:name, '%')") + @Query("SELECT p FROM TestPackageEntity p WHERE :name is null or p.name like concat(cast(:name as text), '%')") List findAllByOptionalNameLike(final String name); TestPackageEntity findByUuid(UUID packageUuid);