Friday, 6 September 2013

Enforce a criteria on all Spring Repository find* methods

Enforce a criteria on all Spring Repository find* methods

Is there a way to apply a default filter/predicate on all queries that are
generated by a JpaRepository, to automatically restrict the results. For
example, if I implement a soft-delete flag, I want to automatically
exclude those results from all further selects.
Hibernate is the JPA implementation beneath, if that helps.

No comments:

Post a Comment