|
HI everyone,
I am implementing security on gets (eg. getProjects(), getUsers() etc) i.e. any list of data fetched from the database using AOP.
I have an interceptor which intercepts at DAO Level for functions those are called. For instance if i have a fuction called getProjects(), the interceptor is ivoked. In my interceptor i am setting a filter for the project based on the project start date which is returning me the correct data.
Now, actually my project mapping has a column of owner_id which comes from project_owner table (id). Now i want to get all the project names along with their owner names (which will require a join) The actual sql query would be like this.
Select pr.project_name, ow.owner_name
from project pr, project_owner ow
where pr.owner_id = ow.id.
Now i am not able to understand how to set the filter for the above output.
Is it possible to achieve using hibernate filters.
Please help.
Thanks.
|