[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-294) Hibernate throwing QueryException when using alias for aggregate functions in named queries

Greg Woolsey (JIRA) noreply at atlassian.com
Sat May 31 01:46:33 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30291 ] 

Greg Woolsey commented on EJB-294:
----------------------------------

I see it when using a construct such as the example from the docs.  This works:

select new Family(mother, mate, offspr)

but adding an alias does not:

select new Family(mother, mate, offspr) as fam

where in my case "Family" is actually an unannotated  POJO referenced by fqcn, and the parameters are entity aliases from the "from" clause.

Am I reading the docs wrong?  Do aliases only work on built-in functions and entity properties?  Seems more like a bug than a feature to me.

> Hibernate throwing QueryException when using alias for aggregate functions in named queries
> -------------------------------------------------------------------------------------------
>
>                 Key: EJB-294
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-294
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>          Components: EntityManager
>    Affects Versions: 3.2.0.ga
>         Environment: Hibernate 3.2 GA, 
>            Reporter: Saravanabavagugan Vengadasundaram
>
> Hibernate throwing QueryException when using alias for aggregate functions in named queries. The following query does not work:
> select sum(emp.salary) as totalSalary from Employee as emp
> select sum(emp.salary) totalSalary from Employee as emp
> but this works:
> select sum(emp.salary) from Employee as emp

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list