-->
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.  [ 1 post ] 
Author Message
 Post subject: Override Filter for Entity
PostPosted: Wed Oct 16, 2013 6:26 am 
Newbie

Joined: Wed Oct 16, 2013 5:25 am
Posts: 1
I'm using a library where defined an Entity with a Filter and also this filter enabled by default for all application. For example such definition:

Code:
@Entity
@Table(uniqueConstraints = @UniqueConstraint(columnNames = "name"))
@Filter(name="salaryFilter", condition=":min <= salary and :max >= salary")
public class Customer implements Identifiable {
    ...
}


I can't change given definition but I need to change a filtering conditions. How can I do that?

Two bad possible solutions that I am thinking about:
1) Redefine all mapping in Customer.hbm.file; Bad solution because every time when original file will be changed I have to change my mapping and also I wouldn't be notified about such changes. Here I've also should mention that I can't redefine only filter it not supported by hibernate (first paragraph http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/xml-overriding.html)
2) I can try to add this information at runtime but I haven't found how to do that.

I'm using hibernate 3.5.6
I will appriciate any suggestions or additional information about Filters.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.