2

Is it possible to specify Join Fetch when using QueryDsl and Spring Data Repository?

2

1 Answer 1

3

No, there's no keyword in Spring Data JPA to trigger a fetch. But you can write a Custom Repository and implement a query using Querydsl there.

Sign up to request clarification or add additional context in comments.

2 Comments

It's possible to use Query annotation, and specify fetch join there. But when I implement QueryDslPredicateExecutor to my repository, I can't mix it with Query annotation.
Yes, that's right. The QueryDslPredicateExecutor can be used to perform queries only using Querydsl Predicates (where you can't use fetch()). For instance: Predicate isOld = person.age.gt(65); repository.findAll(isOld);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.