fix: use COALESCE in audit JPQL to prevent lower(bytea) error
All checks were successful
CI / build (push) Successful in 51s
CI / docker (push) Successful in 31s

Hibernate passes null search param as bytea type, causing PostgreSQL
to fail on LOWER(bytea). COALESCE converts null to empty string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-10 13:21:20 +02:00
parent a1acc0bc62
commit 247ec030e5

View File

@@ -26,8 +26,8 @@ public interface AuditRepository extends JpaRepository<AuditEntity, UUID> {
AND (:from IS NULL OR a.createdAt >= :from)
AND (:to IS NULL OR a.createdAt <= :to)
AND (:search IS NULL
OR LOWER(a.actorEmail) LIKE LOWER(CONCAT('%', :search, '%'))
OR LOWER(a.resource) LIKE LOWER(CONCAT('%', :search, '%')))
OR LOWER(a.actorEmail) LIKE LOWER(CONCAT('%', COALESCE(:search, ''), '%'))
OR LOWER(a.resource) LIKE LOWER(CONCAT('%', COALESCE(:search, ''), '%')))
ORDER BY a.createdAt DESC
""")
Page<AuditEntity> findFiltered(