Added sample for invocation of JDK 8 default method on a repository.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user