-->
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.  [ 1 post ] 
Author Message
 Post subject: joined table filter not used is "IS EMPTY" HPQL query
PostPosted: Mon Jun 01, 2009 4:47 pm 
Newbie

Joined: Mon Feb 02, 2009 8:56 pm
Posts: 2
I use filters to remove soft-deleted entities from query results and collections. I do this using the @Filter annotations on both the table and the joined collection fields for joined tabled. This has been working very well so far, but I have just discovered that it does not work when using the "IS EMPTY" and "IS NOT EMPTY" clauses in queries:

Code:
SELECT DISTINCT p FROM Product p WHERE p.items IS EMPTY


If there is a product that has a single item that has been soft-deleted, I expect it would be removed from the filter and the IS EMPTY would be true. However, that is not the case as the filter condition does not get added to the generated postgres SQL:

Code:
select product0_.product_id as product1_22_, ... from product product0_ where 'F' = product0_.is_deleted_yn and not (exists (select item1_.item_id from item item1_ where product0_.product_id=item1_.product_id))


When it should be:

Code:
select product0_.product_id as product1_22_, ... from product product0_ where 'F' = product0_.is_deleted_yn and not (exists (select item1_.item_id from item item1_ where 'F' = item1_.is_deleted_yn and product0_.product_id=item1_.product_id))


So, is this a bug?

Thanks,
Cameron


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.