Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9 GA (Gosling)
-
Fix Version/s: 1.10.5 (Hopper SR5), 1.11 RC1 (Ingalls), 1.9.7 (Gosling SR7)
-
Component/s: Querydsl
-
Labels:None
-
Environment:Java 1.8
Spring Boot 1.3.0.BUILD-SNAPSHOT
Hibernate (auto version from the "spring-boot-starter-data-jpa" dependency)
QueryDSL 3.6.6
-
Pull Request URL:
Description
The exception is thrown when applying @EntityGraph annotation on the Page<T> findAll(Predicate, Pageable) method in a repository interface.
Example Stacktrace (source: stackoverflow):
org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=appointment,role=com.physioclinic.entity.Appointment.createdBy,tableName=user,tableAlias=user5_,origin=appointment appointmen0_,columns={appointmen0_.createdBy_id ,className=com.physioclinic.entity.User}}] [select count(appointment)
from com.physioclinic.entity.Appointment appointment where lower(concat(concat(appointment.patient.person.name,?1),appointment.patient.person.surname)) like ?2 escape '!']; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=appointment,role=com.physioclinic.entity.Appointment.createdBy,tableName=user,tableAlias=user5_,origin=appointment appointmen0_,columns={appointmen0_.createdBy_id ,className=com.physioclinic.entity.User}}]
Applying the annotation on the Iterable<T> findAll(Predicate) is not resulting with the exception (works just fine).
Attachments
Issue Links
- is duplicated by
-
DATAJPA-684 QueryDslPredicateExecutor + EntityGraph + findAll
-
- Closed
-
- relates to
-
DATAJPA-1087 Regression: query hints not applied to count queries for QueryDSL
-
- Closed
-