-->
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.  [ 8 posts ] 
Author Message
 Post subject: @Filter in @MappedSuperclass
PostPosted: Thu Aug 17, 2006 5:38 am 
Beginner
Beginner

Joined: Fri Apr 28, 2006 3:04 am
Posts: 22
Location: Amsterdam
Well i have an @MappedSuperclass class with default properties like an id (@Id) and timestamps, versioning, hashcode, etc

Now i added a 'disabled' column to this superclass so that every table in my project has a column disabled. When this column is set to disabled it must not be shown in my project. So i created a @Filter with a @Filterdef and this is working just perfectly in normal @Entities (which inherit the superclass).
I define multiple "disableFilters" at all my classes in both class and collection level and enable the filter with one statement (because they all have the same name).
Only i dont want to define the filter at every class at every collection..

So what i want is my @Filter together with my @MappedSuperclass. But somehow he cant find the filters when i put them there (not registering him or something?)


Is this possible? What is the best solution to my problem.. (i could just create an filter for every domain-class and give them different names and enable them all one by one... but that is not what i want offcourse)

_________________
Greetz, Marcel - http://java-aap.blogspot.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 6:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You need to define the filter at the entity level but you can use the same name for all

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 12:56 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
Any plans to add support for this? (I just ran into this myself).

It's not that big of a deal to copy the filters down but if you're going through the trouble to apply shared behaviour via the MappedSuperClass it would be a nice to have if the filter came along as well.

I know there was also talk of Filters getting picked up from Intefaces and that would be a great enhancement as well.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 5:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Not sure I like it, but open a JIRA issue (and even better propose patch).
I need to thought this through

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 21, 2007 12:24 pm 
Newbie

Joined: Sat Apr 21, 2007 12:10 pm
Posts: 1
Same thing happening here.

I have a set of different types of objects that are marked as 'active'. I use filters to place a default condition on these objects. It would be great if I can just specify a filter once on the superclass and the definition would propagate to all it's subclasses.

The actual definition of the 'active' property and it's mapping is already there. Placing the filter definition on the same class would fit it like a glove.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 21, 2007 3:29 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
I created a JIRA enhancement request for it, feel free to vote for it :D


Top
 Profile  
 
 Post subject: JIRA Number
PostPosted: Sun Mar 23, 2008 10:03 am 
Newbie

Joined: Sun Mar 23, 2008 9:56 am
Posts: 2
I encountered the same problem. Can you post link to the JIRA ticket.

UPDATED: Found it!

http://opensource.atlassian.com/project ... se/ANN-594

for others who wanted this feature.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 15, 2008 11:47 am 
Newbie

Joined: Wed Apr 26, 2006 1:10 pm
Posts: 14
Facing same problem, please add this feature.

Sebastien


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.