Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Order-by an attribute from a collection fails #261
The following query fails in Querydsl 2.7.2 because it tries to order by an attribute from a collection:
QIntranetPublicationHandlung pubHand = ereignis.handlungen.any().as(QIntranetPublicationHandlung.class); JPAQuery query = queryEreignis().where( pubHand.published.isTrue().and( pubHand.title.containsIgnoreCase(searchString).or( pubHand.message.containsIgnoreCase(searchString)))).orderBy(pubHand.startDate.desc()); org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: . near line 10, column 43
which refers to
any paths are internally expanded into sub queries which can only be used in the where part, so I will try to serialize any paths in the order by part like this
This might trigger implicit joins, but is maybe a better option than disallowing any paths in the order by part.