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

orderBy does not support aliases declared in select #200

Closed
lallafa opened this issue Jul 19, 2012 · 1 comment
Closed

orderBy does not support aliases declared in select #200

lallafa opened this issue Jul 19, 2012 · 1 comment

Comments

@lallafa
Copy link

@lallafa lallafa commented Jul 19, 2012

I am trying to express this HQL query as Dslquery:

select length(name) as c from Author order by c asc

I tried something like:

  new HibernateQuery(session)
    .from(qAuthor)
    .orderBy(new NumberPath(Integer.class, "c").asc())
    .list(qAuthor.name.length().as("c"));

But this throws an Exception: Undeclared path 'c'. Add this path as a source to the query to be able to reference it

timowest added a commit that referenced this issue Jul 21, 2012
@timowest
Copy link
Member

@timowest timowest commented Aug 4, 2012

Released in 2.7.2

@timowest timowest closed this Aug 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants