-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchJoin(JoinFlag) cancelling #2645
Comments
The Query API follows a builder pattern in which join flags are only applied to the last join. There is no sensible way to use a The proper way to do this is to find the query root from the joins list, and remove the flag from the join: i.e.: We could consider an API to more fluently retrieve the query root, i.e. Unfortunately, I have to reject the idea of the |
@jwgmeligmeyling I don't understand that it just won't work as intended. I already implemented it using java reflection as follow(It works!):
I don't like that, of course. Because it is implemented using reflection as I said. The way to find the query root from the joins list, yes it is a clear valid method, but not universal. I wanna make my ItemReader universal; As your method, ItemReader must know what is join path. I hope you consider it one more time. 🙏 |
Its not universal, because one might have several joins:
Calling Your implementation will be much more reliable (and not require any reflection) by using |
Mind that you can also just remove all |
@jwgmeligmeyling |
Good luck! |
But I believe getFlags method returns an unmodifiable Set, doesn't it? I'm also looking for a way to remove fetch flags from all joins. |
Contrary to many other collections in QueryDsl, |
fetchJoin
is useful for traversing entity-graph. But, when projectioning is required, we could not use it.When projectioning(e.g. min/max/count) is required, I wanna instantiate a original JPAQuery and then query fetchJoin-canceled JPAQuery. For example(in Kotlin):
DefaultQueryMetadata
hasaddJoinFlag(...)
but noremoveJoinFlag(...)
. It would be great to have it!The text was updated successfully, but these errors were encountered: