Allow subselect fetching to be enabled dynamically #6500
Closed
gavinking
started this conversation in
Design Proposals
Replies: 2 comments
-
So what I've implemented is the following:
This is all pretty good now, and I was able to improve a lot of internal code. Especially, I can close this I guess. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We currently support two APIs (
FetchProfile
andEntityGraph
) which allow association fetching to be overridden (i.e. specified explicitly).Unfortunately neither of these APIs allow me to ask for an association to be fetched via the
SUBSELECT
strategy, and that's actually a big missed opportunity. It rarely makes sense to setSUBSELECT
as the default fetching strategy, but there are plenty of cases where it would make sense to turn it on for a specific query.(Arguably, a similar comment applies to batch fetching.)
The thing is that
SUBSELECT
fetching is actually a pretty cool and unique feature of Hibernate that few know exists, mainly because back years ago I made a dumb decision to have it as a thing you set statically.If we fix this, it could be way more useful than it is today.
Beta Was this translation helpful? Give feedback.
All reactions