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.