-->
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.  [ 3 posts ] 
Author Message
 Post subject: Amazing !! HQL with exp and expe
PostPosted: Wed Jul 14, 2004 10:41 am 
Newbie

Joined: Mon Jun 21, 2004 6:18 am
Posts: 15
If I use this HQL it doesn't work ( with 'exp' ), because it returns 'Objects' instead of 'Expedients', and that objects can not be casted to expedients
Code:
SELECT exp FROM Expedient as exp, Tramit as tra where

exp.estado = '11' and

tra.comp_id.numexp = exp.numexp and

((exp.expedientesTipologia.codtip = 'PPL' and tra.codtra = 'BOPA13' ) or (exp.expedientesTipologia.codtip = 'PL' and tra.codtra = 'BOPA10'))

order by tra.fectra desc


But if I use this HQL it works perfectly (with 'expe' or whatever )

Code:
SELECT expe FROM Expedient as exp, Tramit as tra where

expe.estado = '11' and

tra.comp_id.numexp = expe.numexp and

((expe.expedientesTipologia.codtip = 'PPL' and tra.codtra = 'BOPA13' ) or (expe.expedientesTipologia.codtip = 'PL' and tra.codtra = 'BOPA10'))

order by tra.fectra desc



Why??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 11:01 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I guess exp() is a SQL function in your database.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 12:55 pm 
Newbie

Joined: Mon Jun 21, 2004 6:18 am
Posts: 15
I'm using Oracle 9.2 and it has an exp function
Code:
The syntax for the exp function is:

exp ( number )



But I haven't put '(' neither ')' after 'exp'


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.