-->
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: Create Filter on the nested Child of a nested Child
PostPosted: Thu Nov 22, 2012 6:56 am 
Newbie

Joined: Thu Nov 22, 2012 6:40 am
Posts: 2
Hello,

i got a problem with a query a bit complicated. To go straigh this is the SQL query i want to get :

select * from Parent parent
left join fetch parent.child child
left joint fetch child.grandchild grandchild with age < 18;

Child is a collection of Parent, Grandchild a collection of Child

The with clause is forbidden because of the fetch.

So i got to use filters. But I didn't find the way to apply the filter on Grandchild I think this is because the @Filter doesn't appear in the Parent class.

For instant I declare the Filter (@FilterDef) in the Grandchild class, and I put the
@Filter(name="age", condition = "age < :age_param) just before the declaration
of the Collection<GrandChild> attribute in the Child class .

Is there a way to obtain this query ? am I doing something wrong ?

Thanks for help


Top
 Profile  
 
 Post subject: Re: Create Filter on the nested Child of a nested Child
PostPosted: Tue Nov 27, 2012 11:35 am 
Newbie

Joined: Thu Nov 22, 2012 6:40 am
Posts: 2
Up !

Help please !


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.