"The owner of the fetched association was not present in the select list" error on SimpleJpaRepository#getCountQuery #3765
Labels
status: waiting-for-feedback
We need additional information before we can continue
status: waiting-for-triage
An issue we've not yet triaged
Hi.
I'm having the error in the stack trace below using sprint-data-jpa 3.4.2 when calling JpaSpecificationExecutor#findAll(@Nullable Specification spec, Pageable pageable).
The specification being passed as an argument contains a fetch join (such as
root.fetch(Entity_.attribute, JoinType.LEFT)
).The exception is thrown by SimpleJpaRepository#getCountQuery(@Nullable Specification<S> spec, Class<S> domainClass) when the entity manager tries to create the query.
Should the
getCountQuery
method remove the fetch from fetch joins before requesting the entity manager to create the query?It seems to be related to issue 2348.
Thank you.
The text was updated successfully, but these errors were encountered: