Sergey Skryabin opened DATAJPA-1061 and commented
@Query("SELECT c.name AS n FROM cats c")
List<String> findCats(Sort sort);
...
findCats(new Sort("n"));
doesn't work ("The state field path 'c.n' cannot be resolved to a valid type."). Although
@Query("SELECT lower(c.name) AS n FROM cats c")
List<String> findCats(Sort sort);
...
findCats(new Sort("n"));
works fine.
http://docs.spring.io/spring-data/jpa/docs/1.11.x/reference/html/#jpa.query-methods.sorting
says: The properties actually used within the Order instances of Sort need to match to your domain model, which means they need to resolve to either a property or an alias used within the query.
Affects: 1.11 GA (Ingalls)
Attachments:
Referenced from: pull request #276
Backported to: 2.1.10 (Lovelace SR10), 1.11.23 (Ingalls SR23)
3 votes, 9 watchers
Sergey Skryabin opened DATAJPA-1061 and commented
doesn't work ("The state field path 'c.n' cannot be resolved to a valid type."). Although
works fine.
http://docs.spring.io/spring-data/jpa/docs/1.11.x/reference/html/#jpa.query-methods.sorting
says: The properties actually used within the Order instances of Sort need to match to your domain model, which means they need to resolve to either a property or an alias used within the query.
Affects: 1.11 GA (Ingalls)
Attachments:
Referenced from: pull request #276
Backported to: 2.1.10 (Lovelace SR10), 1.11.23 (Ingalls SR23)
3 votes, 9 watchers