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?
|