[
https://jira.jboss.org/jira/browse/HIBERNATE-113?page=com.atlassian.jira....
]
Igor A Tarasov closed HIBERNATE-113.
------------------------------------
Resolution: Won't Fix
Sorry, I see that EJB-QL specification does not support 'AS' aliases in
'SELECT' clause. I need use native SQL.
EJB-QL select aliases lost
--------------------------
Key: HIBERNATE-113
URL:
https://jira.jboss.org/jira/browse/HIBERNATE-113
Project: Hibernate
Issue Type: Bug
Environment: JBoss 5.0.1.GA
Postgresql server 8.3.7
Reporter: Igor A Tarasov
Assignee: Steve Ebersole
Priority: Critical
Hibernate lost select aliases in EJB-QL.
My EJB-SQL:
SELECT EXTRACT(YEAR FROM pay.payDate) AS date_value, SUM(pay.sum) FROM PaymentDO AS pay
GROUP BY date_value
Hibernate generted SQL:
SELECT EXTRACT(YEAR FROM paymentdo0_.payDate) AS col_0_0_, SUM(paymentdo0_.sum) AS
col_1_0_ FROM PaymentDO paymentdo0_ GROUP BY date_value
Result error:
org.postgresql.util.PSQLException: ERROR: column "date_value" not exists
It is occur because I want to use GROUP BY statement with value of result of EXTRACT
function as alias: "SELECT EXTRACT(YEAR FROM pay.payDate) AS date_value", but
hibernate lost my alias 'date_value' and
rename it to 'col_1_0_'
I can't fint workaround !!!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira