Using Spring Data JPA can I do a query by example where a particular entity instance is used as the search criteria?
For example (no pun intended), if I have a
This is now possible with Spring Data. Check out http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example
Person person = new Person();
person.setLastname("Smith");
Example example = Example.of(person);
List results = personRepository.findAll(example);
Note that this requires very recent 2016 versions
org.springframework.data
spring-data-jpa
1.10.1.RELEASE
org.springframework.data
spring-data-commons
1.12.1.RELEASE
see https://github.com/paulvi/com.example.spring.findbyexample