-->
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: Hibernate and UNION clause
PostPosted: Mon Oct 18, 2004 8:53 pm 
Newbie

Joined: Mon Oct 18, 2004 8:51 pm
Posts: 1
How does hibernate handle UNION in a SQL. I have to run a query that selects a different set of columns from the same table based on a parameter. I have to use the union clause, but I can't find any lead on how would Hibernate's Query object address this issue.

For a table say, Employee with columns, Id, FName, LName, I want to do the following

select ID, FName as Name where LName is null
UNION
select ID, LName as Name where FName is null
order by 2

How can I do it using Hibernate's Query object

Any help would be appreciated

THanks,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 18, 2004 10:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Union is not supported in HQL.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 18, 2004 10:40 pm 
Newbie

Joined: Wed Feb 25, 2004 11:41 pm
Posts: 19
Location: China
create view in ur DB

_________________
who can tell me why?


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.