blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

Join on subquery and sort by left joined column causes unknown parameter error when inline ID query is disabled

Open kizzywuzzit opened this issue 9 months ago • 0 comments

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

kizzywuzzit avatar Mar 06 '25 16:03 kizzywuzzit