-->
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: Union and outer joins in filter condition
PostPosted: Tue Oct 10, 2006 11:29 am 
Newbie

Joined: Mon Sep 18, 2006 5:21 am
Posts: 6
Hibernate version: 3.1.3

Hi,
I am trying to use Hibernate's filters. I have condition like:
Code:
myId in (select id from A union select id from B)


unfortunately in runtime if I apply this filter I am getting sql like:
Code:
select ... where table_.myId in (select id from A a table_.union select id from B b)


Simply Hibernate treats keyword "union" as a name of column in table instead as a keyword and prefixes it with "table_.".

Similar situation is if I have two outer joins in filter's condition. Hibernate is generateng sql like:
Code:
select ... from A a outer join ..., table_.B table_.b outer join ...


again tebale names of table and alias in second outer join are treated as a name of column table and are prefixed with "table_.".

Does Hibernate support "union" and multiply outer joins in filter's condition's subquery?

regards
John

_________________
John


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 4:11 pm 
Newbie

Joined: Mon May 03, 2004 11:53 pm
Posts: 7
See Hibernate Users Faq - Advanced Problems at: http://www.hibernate.org/117.html#A20.

Does HQL support UNION (or INTERSECT)?
Not at this time. You may use a native SQL query for this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 4:19 pm 
Newbie

Joined: Mon May 03, 2004 11:53 pm
Posts: 7
Hibernate is plannig to add support for unions in 3.2.1. They just released 3.2.0 GA on Monday 10.16.2006. See the following link related to unions:

http://opensource.atlassian.com/project ... 0?page=all

You can use unions in native sql.


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.