feat: Add applyFilter on projected query#108
Conversation
| * This will be either: | ||
| * * [TypeSafeCriteriaBuilder], for normal queries (supports applyFilter {}) | ||
| * * [ProjectedTypeSafeCriteriaBuilder], for queries with projections (does not support extra applyFilter {}) | ||
| * * [ProjectedTypeSafeCriteriaBuilder], for queries with projections (supports applyFilter {} for adding WHERE/JOIN/ORDER conditions) |
There was a problem hiding this comment.
this feels slightly misleading bc the one before also supports apply filter "for adding WHERE/JOIN/ORDER conditions" right? there is no difference on the applyFilter for TypeSafeCriteriaBuilder and ProjectedTypeSafeCriteriaBuilder ?
There was a problem hiding this comment.
true yeah, I can update it. There should be no difference in the applyFilter for both TypeSafeCriteriaBuilder and ProjectedTypeSafeCriteriaBuilder.
| * the lambda returning the projection can be applied. For non-projected queries, there is no problem in applying | ||
| * multiple lambdas. | ||
| * Both builders support applying filters through the applyFilter method. The difference is that | ||
| * ProjectedTypeSafeCriteriaBuilder does not allow calling project() within applyFilter since the projection |
There was a problem hiding this comment.
does the non-project one support that?
There was a problem hiding this comment.
ah no, we don't have any filter method that does projection. Let me update it for clarity
There was a problem hiding this comment.
like I know you can (Must) call project at the end of the first lambda for ProjectedTypeSafeCriteriaBuilder
but I think you cannot do it in the lambda for applyFilter for TypeSafeCriteriaBuilder
it has an applyProjection method of its own
so I am thinking we just move the applyFilter to the parent? would that make sense?
Following up from this comment about the need to apply filter usage on a projected query. I put up this PR to add
applyFiltermethod that can be called on the projection.