Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projections.bean discards aliases required for sorting #1379

Closed
zdila opened this issue May 18, 2015 · 0 comments
Closed

Projections.bean discards aliases required for sorting #1379

zdila opened this issue May 18, 2015 · 0 comments
Labels
bug
Milestone

Comments

@zdila
Copy link

@zdila zdila commented May 18, 2015

final List<Expression<?>> list = new ArrayList<>();
final NumberPath<Double> avgAmountPath = Expressions.numberPath(Double.class, "avgAmount");
list.add(QEntity.entity.amount.avg().as(avgAmountPath));
jpaQuery.groupBy(QEntity.entity.something);
jpaQuery.orderBy(avgAmountPath.asc());

// this throws exception: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'avgAmount' in 'order clause'
jpaQuery.list(Projections.bean(MyResult.class, list.toArray(new Expression[0])));

// this is ok
jpaQuery.list(list.toArray(new Expression[0]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.