-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: ora-00904
PostPosted: Thu Sep 15, 2005 12:11 am 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
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


Top
 Profile  
 
 Post subject: Aliases
PostPosted: Thu Sep 15, 2005 7:48 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
Can I direct the hibernate engine not to use aliases when columns from the select clause are used in the where clause. Thank You


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 9:10 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
this query don't work with postgresql 8.1 beta too

for example

select id from test where id=0 - work
select id as x from test where id=0 - work
select id as x from test where x=0 - doesn't work

this is probably hibernate bug - what is your hibernate version ?


Top
 Profile  
 
 Post subject: v - 3.0
PostPosted: Thu Sep 15, 2005 9:50 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
I am using 3.0.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 10:13 pm 
Beginner
Beginner

Joined: Tue Aug 16, 2005 11:06 pm
Posts: 46
I duplicated this problem in HB3.0.5 with HSQLDB 8.0.1.

_________________
Jason Li
Don't forget to rate:)


Top
 Profile  
 
 Post subject: I did too with 3.1 beta
PostPosted: Thu Sep 15, 2005 10:23 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
I did too with 3.1 beta


Top
 Profile  
 
 Post subject: any hints
PostPosted: Fri Sep 16, 2005 12:55 pm 
Beginner
Beginner

Joined: Thu Jul 28, 2005 1:19 pm
Posts: 24
Any hints from the hibernate development team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 1:14 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
This is bug - you can add entry in JIRA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.