I have a foo that has a relationship to many bar’s.
When I delete bar’s in my system I want to keep them in the database for some crazy business reason so I just set a deleted field to true.
Can I specify in my hibernate mapping that I only want my collection to hold elements where that field is false?
Hibernate provides filters to accomplish this.
Example beans:
Example mappings NB: the
filterelementExample unit test: