-->
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: HELP-Transform a complex sql query into HQL
PostPosted: Mon Mar 15, 2004 11:19 am 
Newbie

Joined: Mon Mar 15, 2004 10:07 am
Posts: 4
Hi,

I have this sql query but i don't know how to write it in HQL...
Thanks for your help.

SELECT *
FROM
(
SELECT BOOKING_ID AS lastBOOKING_ID, max(WORKFLOW_DATE)AS lastDATE
FROM BO_WORKFLOW
WHERE WORKFLOW_STATUS = 0
GROUP BY BOOKING_ID
)
INNER JOIN BO_WORKFLOW ON (lastBOOKING_ID=BOOKING_ID) and (lastDATE=WORKFLOW_DATE)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 1:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You'll have to show your mapping and express your request in plain english too. It'll help us (and you :) )

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
From-clause subselects are not supported in HQL and probably will not ever be. Use createSQLQuery().


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.