-->
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: HQL problem
PostPosted: Fri Apr 16, 2004 12:35 pm 
Newbie

Joined: Sun Nov 30, 2003 10:09 am
Posts: 14
Hello everybody,
I am using hibernate 2.1.
I have two classes UserDTO.java and EmployeeDTO.java.
Here relationship is employee has user.
EmployeeDTO contains an user object.
I want to execute following SQL:

SELECT em.id from employee
except
SELECT em.id from Employee em, User us WHERE em.id = us.employee

I mean I want to run except operation in HQL.
If not support in HQL, is there any alternative way in which i can run my sql in HQL format.
Regards
banik


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 16, 2004 10:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
select em.id from Employee em
where not exists (from User u where u.employee = em)


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Sat Apr 17, 2004 12:33 am 
Newbie

Joined: Sun Nov 30, 2003 10:09 am
Posts: 14
Hello Gavin,
Ya, it works. thank you so much. -:).
Regars Banik


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 17, 2004 12:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No problem. Good luck!


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.