Skip to content

Commit

Permalink
Merge pull request #935 from eclipse-tractusx/fix/pool-name-search
Browse files Browse the repository at this point in the history
fix(pool): name search behaviour
  • Loading branch information
nicoprow authored May 22, 2024
2 parents fb07739 + 4b79e56 commit f4c7c60
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface LegalEntityRepository : JpaRepository<LegalEntityDb, Long>, JpaSpecifi
fun byLegalName(legalName: String?) =
Specification<LegalEntityDb> { root, _, builder ->
legalName?.takeIf { it.isNotBlank() }?.let {
builder.like(root.get<NameDb>(LegalEntityDb::legalName.name).get(NameDb::value.name), legalName)
builder.like(builder.lower(root.get<NameDb>(LegalEntityDb::legalName.name).get(NameDb::value.name)), "%${legalName.lowercase()}%")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface LogisticAddressRepository : JpaRepository<LogisticAddressDb, Long>, Jp
fun byName(name: String?) =
Specification<LogisticAddressDb> { root, _, builder ->
name?.takeIf { it.isNotBlank() }?.let {
builder.like(root.get(LogisticAddressDb::name.name), name)
builder.like(builder.lower(root.get(LogisticAddressDb::name.name)), "%${name.lowercase()}%")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface SiteRepository : JpaRepository<SiteDb, Long>, JpaSpecificationExecutor
fun byName(name: String?) =
Specification<SiteDb> { root, _, builder ->
name?.takeIf { it.isNotBlank() }?.let {
builder.like(root.get(SiteDb::name.name), name)
builder.like(builder.lower(root.get(SiteDb::name.name)), "%${name.lowercase()}%")
}
}

Expand Down

0 comments on commit f4c7c60

Please sign in to comment.