title: Spring JPA Query Creation - Using By with a Predicate
body: <p>I would like to create a Spring Data JPA query that uses a default criterion and a dynamic predicate.</p>
  
  <p>For example using Customer entity:</p>
  
  <p><code>findByFirstnameIn(List&lt;String&gt; names, Predicate predicate);</code></p>
  
  <p>I can't find similar examples in the <a href="https://docs.spring.io/spring-data/jpa/docs/1.11.9.RELEASE/reference/html/#jpa.query-methods.query-creation" rel="nofollow noreferrer">Spring Data JPA documentation</a></p>
  
  <p>Another solution would be to use do </p>
  
  <p><code>findAll(predicate.and(customer.firstname.in(names)))</code></p>
  
  <p>but I would like to avoid this additional line of code.</p>