-->
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.  [ 4 posts ] 
Author Message
 Post subject: Outer join from subquery
PostPosted: Fri Dec 11, 2009 1:33 pm 
Newbie

Joined: Fri Dec 11, 2009 1:23 pm
Posts: 5
Hello!
I want to rewrite this query from SQL to Criteria (is preferred), or HQL.
Code:
select * from
  curses curs
  LEFT OUTER JOIN
  (select * from users_curses where user_id=?)
  usCurs on curs.semester_id = usCurs.semester_id and curs.curse_id = usCurs.curse_id where curs.subject_id = ? and curs.semester_id = ?;


Thank you for helping!


Top
 Profile  
 
 Post subject: Re: Outer join from subquery
PostPosted: Tue Dec 15, 2009 12:25 am 
Newbie

Joined: Tue Jun 10, 2008 4:40 am
Posts: 13
i have same sql, but i don't how to convert to Hql
this my SQL
Code:
select item.idItem,costing.dateCost
from Item item left join(select * from Costing where std_01 <='12') costing
on item.idItem=costing.idItem;


so i tried to HQL like this, but still got error
Code:
select item.idItem,costing.dateCost
from Item  as item left join(select costing.std01 from
     Costing where costing.std01 <='12') as costing


Top
 Profile  
 
 Post subject: Re: Outer join from subquery
PostPosted: Tue Dec 15, 2009 11:17 pm 
Newbie

Joined: Tue Jun 10, 2008 4:40 am
Posts: 13
Do you have solution?

thanks for your share


Top
 Profile  
 
 Post subject: Re: Outer join from subquery
PostPosted: Fri Feb 19, 2010 2:10 pm 
Newbie

Joined: Fri Dec 11, 2009 1:23 pm
Posts: 5
Adding predicates to the join condition using Criteria Query


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