Hello,
I have a project that consists most of CRUDs, with JSF, JPA and QueryDSL JPA as helper library.
I have the need to do queries with dynamic WHERE and ORDER BY, for real (lazy) pagination.
For some filters, I only want to do the JOIN and the WHERE if some filter was filled. In other words:
pseudocode
if filter was filled
do JOIN
do WHERE
end if
Problem is, I have some filters that use the same JOIN.
If I fill both filters, the same JOIN is added twice to the query.
Is there a native way to QueryDSL do something like this:
pseudocode
if JOIN was added
ignore JOIN (or reuse existing JOIN)
end if
Is that possible?