Added sample for invocation of JDK 8 default method on a repository.

This commit is contained in:
Oliver Gierke
2014-07-07 16:08:05 +02:00
parent 0a98efaf20
commit d748923519
3 changed files with 20 additions and 0 deletions

View File

@@ -36,4 +36,10 @@ public interface CustomerRepository extends Repository<Customer, Long> {
Optional<Customer> findOne(Long id);
<S extends Customer> S save(S customer);
Optional<Customer> findByLastname(String lastname);
default Optional<Customer> findByLastname(Customer customer) {
return findByLastname(customer.lastname);
}
}