title: Handling soft-deletes with Spring JPA
body: <p>I have a table <code>Stuff</code> defined as...</p>
  
  <pre><code>id, &lt;fields&gt;..., active
  </code></pre>
  
  <p>Active is the soft-delete flag and is always <code>1</code> or <code>0</code>. Long term this may go away in favor of a historical table.</p>
  
  <pre><code>public interface StuffRepository extends JpaRepository&lt;StuffEntity, Long&gt; {} 
  </code></pre>
  
  <p>In code, we <em>always</em>  use active records. Is there any way to get Spring to always append an <code>active=1</code> condition to queries generated for this repository? Or more ideally allow me to extend the grammar used to generate the queries?</p>
  
  <p>I understand that I can create named <code>@queues</code> everywhere but then I lose the convenience of the generated queries. I also want to avoid polluting the interface with "active" methods.</p>
  
  <p>I am using Hibernate 4.2 as my JPA implementation if that matters.</p>