title: Spring Data JPA - Many columns in where clause
body: <p>I need to determine if an entity has already been persisted. Unfortuantely, I do not have the id, but I can determine that the entity is already persisted if the value of six other fields of the entity match a persisted entity. I'm using Spring JPA repositories and know that I can do the following:</p>
  
  <pre><code>Test findByField1AndField2And...(String field1, String field2,...)
  </code></pre>
  
  <p>Is there a way to do something similar to:</p>
  
  <pre><code> @Query("SELECT t "
             + "FROM Test t "
             + "WHERE "
             + "t.field1 = :testWithSomeFieldsPopulated.field1 and "
             + "t.field2 = :testWithSomeFieldsPopulated.field2 and ..." ) 
  Test findByTest(@Param("testWithSomeFieldsPopulated") Test testWithSomeFieldsPopulated)
  </code></pre>