The main problem was a bug in querydsl 3.3.2 that has been resolved resolved in querydsl 3.3.3 to which we just updated in in spring-data-build/#70. Cleaner usage of querydsl API and less brittle casting. Added test case for sorting by nested association property that is wrapped in a function, e.g. lower(…). Original pull request: #87.