title: Query creation in Spring Data - dynamic where clause
body: <p>Is there a way in Spring data to dynamically form the where clause?</p>
  
  <p>What I want to do is have a method (which is like the findBy / get method) which runs a WHERE and AND using the mentioned properties which are NOT NULL.</p>
  
  <p>For example,</p>
  
  <pre><code>Consider the object Person [firstName, lastName, age, gender]
  </code></pre>
  
  <p>Our method looks something like this</p>
  
  <pre><code>findBy_IfNotNullFirstName_AndIfNotNullLastName_AndIfNotNullAge_AndIfNotNullGender(String firstName, String lastName, Integer age, String gender)
  </code></pre>
  
  <p>Thanks.</p>