KamoCRM

Build the search pattern outside the query, and parse the query in a test

FixMediaService
Shipped
25 ஆகஸ்ட், 2026 அன்று 3:29 PM UTC
Author
Kamo
Commit
d26cc10

likePattern turns an absent search term into '%' so no null parameter ever reaches a string expression, and escapes % and _ in the term so a search for a literal underscore does not match any character. SystemBugQueryTest parses both the select and the count query against the real entity model. The existing tests mock the repository, so the JPQL was never executed by anything — which is exactly how a list that 500d on every unfiltered load shipped green.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing