fetchJoin(JoinFlag) cancelling
See original GitHub issuefetchJoin
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):
val q = from(foo).innerJoin(bar).fetchJoin().where(...).orderBy(...)
val maxId = q.select(foo.id.max()).removeFlag(FETCH).fetchOne()
val result = q.where(foo.id.lt(maxId)).fetch()
DefaultQueryMetadata
has addJoinFlag(...)
but no removeJoinFlag(...)
. It would be great to have it!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jwgmeligmeyling Thank you for your help! In my case, your last help is best!
Mind that you can also just remove all
FETCH
flags:query.getMetadata().getJoins().forEach(join -> join.getFlags().remove(FETCH))