title: How to enable/disable a global filter for repository methods in Spring Data Jpa
body: <p>In my project, all the domain classes have a <code>boolean voided</code> field, to manage the soft delete. Problem is, for all the repository methods, I had to manually override the <code>@Query</code> with <code>voided = false</code>, to get the active entries.</p>
  
  <p>Is there a filtering mechanism in Spring Data JPA to define globally? </p>
  
  <p>For example if the filter is enable, then <code>repository.findAll()</code>; should return all entities with <code>voided = false</code>. If filter is disabled it will return all the data without considering voided.</p>