amended JPQL queries, application starts

This commit is contained in:
Michael Hoennig 2024-02-05 08:58:59 +01:00
parent 345359fd18
commit 73ea6b8ccc
3 changed files with 7 additions and 5 deletions

View File

@ -25,8 +25,10 @@ public interface HsOfficeDebitorRepository extends Repository<HsOfficeDebitorEnt
@Query(""" @Query("""
SELECT debitor FROM HsOfficeDebitorEntity debitor SELECT debitor FROM HsOfficeDebitorEntity debitor
JOIN HsOfficePartnerEntity partner ON partner.uuid = debitor.partner.uuid JOIN HsOfficePartnerEntity partner ON partner.uuid = debitor.partner.uuid
JOIN HsOfficePersonEntity person ON person.uuid = partner.person.uuid JOIN HsOfficeRelationshipEntity rel ON rel.uuid = partner.partnerRole.uuid
JOIN HsOfficeContactEntity contact ON contact.uuid = debitor.billingContact.uuid JOIN HsOfficePersonEntity person ON person.uuid = rel.relHolder.uuid
JOIN HsOfficeContactEntity contact
ON contact.uuid = debitor.billingContact.uuid OR contact.uuid = rel.contact.uuid
WHERE :name is null WHERE :name is null
OR partner.details.birthName like concat(cast(:name as text), '%') OR partner.details.birthName like concat(cast(:name as text), '%')
OR person.tradeName like concat(cast(:name as text), '%') OR person.tradeName like concat(cast(:name as text), '%')

View File

@ -13,8 +13,9 @@ public interface HsOfficePartnerRepository extends Repository<HsOfficePartnerEnt
@Query(""" @Query("""
SELECT partner FROM HsOfficePartnerEntity partner SELECT partner FROM HsOfficePartnerEntity partner
JOIN HsOfficeContactEntity contact ON contact.uuid = partner.contact.uuid JOIN HsOfficeRelationshipEntity rel ON rel.uuid = partner.partnerRole.uuid
JOIN HsOfficePersonEntity person ON person.uuid = partner.person.uuid JOIN HsOfficeContactEntity contact ON contact.uuid = rel.contact.uuid
JOIN HsOfficePersonEntity person ON person.uuid = rel.relAnchor.uuid
WHERE :name is null WHERE :name is null
OR partner.details.birthName like concat(cast(:name as text), '%') OR partner.details.birthName like concat(cast(:name as text), '%')
OR contact.label like concat(cast(:name as text), '%') OR contact.label like concat(cast(:name as text), '%')

View File

@ -161,7 +161,6 @@ public class ImportOfficeData extends ContextBasedTest {
@MockBean @MockBean
HttpServletRequest request; HttpServletRequest request;
@Test @Test
@Order(1010) @Order(1010)
void importBusinessPartners() { void importBusinessPartners() {