title: JPA Custom @Query for counting !boolean
body: <p>I am doing a lot of arithmetic and joins in my actual Query, all of which are working fine.</p>
  
  <p>I have the following (Simplified version for the purpose of this question) working custom query, where i am counting the number of instances with 'isSuccess == true':</p>
  
  <pre><code>@Query("SELECT NEW com.xyz.MyEntity(S.name, SUM(S.isSuccess)) FROM Sample AS S")
  public List&lt;MyEntity&gt; caclulateResults();
  </code></pre>
  
  <p>However I would like to count the 'S.isSuccess = false' instead and I am curious about what would be the easiest way to achieve this? The JPA documentation is of not much help here. Thank you!</p>