blaze-persistence
blaze-persistence copied to clipboard
Join on subquery and sort by left joined column causes unknown parameter error when inline ID query is disabled
The scenario required to hit this is definitely a bit weird, but I just happened to need weird. When a query joins on a windowed CTE, AND sorts by a coalesced left joined column, it produces
java.lang.IllegalArgumentException: Invalid or unknown parameter with name: ids_0_0
This stems from the fact that the ids_# parameters are never registered in the parameter manager, so when getObjectQueryById gets called it creates the query with only the param_# parameters registered. When PaginatedTypedQueryImpl iterates and calls setParameter the underlying AbstractCustomQuery doesn't have it in the parameter list, and throws the exception.
PR: https://github.com/Blazebit/blaze-persistence/pull/2011