-->
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: @Filter not working for @OneToMany association
PostPosted: Wed May 09, 2007 8:02 pm 
Beginner
Beginner

Joined: Wed Apr 18, 2007 1:44 pm
Posts: 27
Hi folks,

(Note: I have posted this into the users forum too because I'm not really sure it's just an annotations problem or what)

I have defined this filter

class Product {
....
@OneToMany(mappedBy="target", cascade=CascadeType.ALL)
@Filter(name="productReviewFilter", condition="filtered = false")
private List<Review> reviews = new ArrayList<Review>();
....
}

but one trying to enable it for the session, I get:

session.enableFilter("productReviewFilter");

Exception in thread "main" org.hibernate.HibernateException: No such filter configured [productReviewFilter]

Am I missing something?

TIA
Cheers,
Carlos


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 10, 2007 12:45 pm 
Newbie

Joined: Mon Apr 23, 2007 10:22 am
Posts: 5
I think you need to have an @FilterDef annotation to define the filter.

The @Filter annotation specifies where the filter should be applied when it's enabled.

-james.


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.