Hello
I have the following statement:
session.createCriteria(Wqdaily.class)
.add(Expression.between("observeDate", startDate, endDate))
.add(Expression.eq("wqsite", site)).setProjection(projectionList).list();
in the projectionlist one property is property1. This translates to:
select this_.OBSERVE_DATE as y0_, this_.TEMPERATURE as y1_ from WQDAILY this_ where y0_ between ? and ? and this_.SITE_ID=?
when the statement executed, I get back: ORA-00904: "Y0_": invalid identifier
I am using oracle10g in my sqlplus I ran the following statement:
SQL> select OBSERVE_DATE as x from wqdaily where x between '12/12/1992' and '12/12/1994';
And I got the following area which reflects what the first session.createCriteria is doing:
select OBSERVE_DATE as x from wqdaily where x between '12/12/1992' and '12/12/1994'
*
ERROR at line 1:
ORA-00904: "X": invalid identifier
As seen Oracle 10g at least does not support the AS (aliases) for columns. Is this a bug in hibernate? JDBC? or Is there a work around? Or maybe I am missing something there.
appreciate any replies.
Thanks
|