-->
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.  [ 2 posts ] 
Author Message
 Post subject: Apply filter to SQL
PostPosted: Fri Dec 24, 2010 7:11 am 
Newbie

Joined: Fri Dec 17, 2010 3:12 am
Posts: 8
Hi,
I need to apply a filter to an SQL query. I am aware <filter> does not work on SQLs.
I tried to append an AND clause to my SQL query.
But that doesn't serve my purpose.
For example :
select * from TBL_Currency
select * from TBL_Branch


To the above queries, I need to apply a filter, so that my query becomes -
select * from TBL_Currency where currencyId in (my filter query)
select * from TBL_Branch where branchId in (my filter query)


Someone might suggest to add a couple of more queries to my hbm.xml.

But in my case there are hundreds of queries and based on some condition, I need to append the filter clause. And it's not a feasible option to add another hundred queries.

Still struggling. Any suggestions?


Top
 Profile  
 
 Post subject: Re: Apply filter to SQL
PostPosted: Sat Dec 25, 2010 9:22 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
so how would you do this without using hibernate? Everything you can do without, you can still do.
I think Hibernate could help you out using either HQL+filters or Criteria API, but if you really need to use SQL, we can't do much.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.