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: Joins in Filters
PostPosted: Tue May 09, 2006 7:25 am 
Newbie

Joined: Mon Sep 26, 2005 4:08 am
Posts: 15
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 10:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No, you'd need to use subqueries.


Top
 Profile  
 
 Post subject: Filter Joins
PostPosted: Tue May 09, 2006 1:14 pm 
Newbie

Joined: Mon Sep 26, 2005 4:08 am
Posts: 15
Can u plz give me an example of subqueries using filters.

Thanx.


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.