Fixed compilation error

This commit is contained in:
Michele Guarnaccia 2020-05-18 19:15:18 +02:00
parent fbefae05ec
commit cd51e118df
2 changed files with 5 additions and 1 deletions
persistence-modules/spring-data-jpa-5/src/main/java/com/baeldung

View File

@ -17,6 +17,10 @@ public class CustomerDto {
this.phone = c.phone;
}
public long getId() {
return this.id;
}
public Customer convertToEntity() {
Customer c = new Customer();
c.id = id;

View File

@ -38,7 +38,7 @@ public class CustomerService {
}
public Customer updateCustomer(CustomerDto dto) {
Customer myCustomer = repo.findById(dto.id);
Customer myCustomer = repo.findById(dto.getId());
mapper.updateCustomerFromDto(dto, myCustomer);
repo.save(myCustomer);
return myCustomer;