-->
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: Does hibernate have or support a UNION Funtionality?
PostPosted: Sun Jun 08, 2008 6:54 am 
Beginner
Beginner

Joined: Mon Aug 13, 2007 2:37 am
Posts: 22
Hi guys,

I'm trying to write a search engine query for a website. So, I'm wondering if Hibernate has a UNION function or something similar to combine query results? Please, I would apprecite any examples you can provide.

Thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 7:22 am 
Regular
Regular

Joined: Tue Apr 01, 2008 5:39 pm
Posts: 61
sorry no. Instead please use

option 1.
<sql-query name="someQueryWithUnion">
....
</sql-query>

In your external mappoing.

Or

option 2.

write two name queries and map it to two set.

Than do set1.addAll(set2).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 08, 2008 10:37 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Writing tow named queries and mapping it to two sets is how I tyically do this.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.