been staring at a repository file with 25+ methods lately and it was getting ridiculous. every time a new filter comes in, i just keep adding more lines until the whole thing is
unreadable a total nightmare. i finally switched to using
spring data jpa specifications to handle all those dynamic queries. it basically wiped out about
3 years of repository debt in one go by letting me combine predicates instead of writing unique methods for every edge case.
it feels like magic when you stop manually mapping every single search param . anyone else still stuck using the old method-per-query approach?
link:
https://dzone.com/articles/spring-data-jpa-repository-debt