Please sign in to comment.
DATAJPA-252 - Applying sort to manually defined queries considers joins.
If a manually defined query uses outer joins, prefixing the sort criteria handed to the execution of the method causes an additional join being added as the JPA considers path expressions to be inner joins always (see Sect. 4.4.4, JPA 2.0 spec). We now parse the outer join aliases potentially used in a manually defined JPQL query and do not prefix the query with the root entity's alias.
- Loading branch information...
Showing with 129 additions and 11 deletions.
- +64 −6 src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
- +13 −0 src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java
- +50 −3 src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
- +2 −2 src/test/java/org/springframework/data/jpa/repository/sample/UserRepository.java