title: Spring Jpa Query by Example collection
body: <p>Let's say I have an entity </p>
  
  <pre><code>public class Person {
      private String id;
      private String firstname;
      private String lastname;
      private Set&lt;Car&gt; ownedCars;
  }
  </code></pre>
  
  <p>Is there a way I can use query by example to find any person named James having both a Ferrari and Lamborghini?</p>
  
  <p>If I use:</p>
  
  <pre><code>Person p = new Person();
  p.setName("James");
  p.getOwnedCars.addCar(new Car("Lamborgnihi"));
  p.getOwnedCars.addCar(new Car("Ferrari"));
  Example&lt;Person&gt; exampleOfPerson = Example.of(p);
  List&lt;Person&gt; foundPersons = personRepository.finaAll(exampleOfPerson);
  </code></pre>
  
  <p>it seems it queries only on person's attributes and ignores any child collections.</p>