mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 13:05:49 +00:00
devoxx: refactor
This commit is contained in:
parent
554a04e659
commit
67919cfd21
1 changed files with 5 additions and 5 deletions
|
@ -43,14 +43,14 @@ public class ClinicServiceImpl implements ClinicService {
|
|||
|
||||
private PetRepository petRepository;
|
||||
private VetRepository vetRepository;
|
||||
private OwnerRepository ownerRepository;
|
||||
private OwnerRepository ownerRepo;
|
||||
private VisitRepository visitRepository;
|
||||
|
||||
@Autowired
|
||||
public ClinicServiceImpl(PetRepository petRepository, VetRepository vetRepository, OwnerRepository ownerRepository, VisitRepository visitRepository) {
|
||||
this.petRepository = petRepository;
|
||||
this.vetRepository = vetRepository;
|
||||
this.ownerRepository = ownerRepository;
|
||||
this.ownerRepo = ownerRepository;
|
||||
this.visitRepository = visitRepository;
|
||||
}
|
||||
|
||||
|
@ -63,19 +63,19 @@ public class ClinicServiceImpl implements ClinicService {
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Owner findOwnerById(int id) throws DataAccessException {
|
||||
return ownerRepository.findById(id);
|
||||
return ownerRepo.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public Collection<Owner> findOwnerByLastName(String lastName) throws DataAccessException {
|
||||
return ownerRepository.findByLastName(lastName);
|
||||
return ownerRepo.findByLastName(lastName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOwner(Owner owner) throws DataAccessException {
|
||||
ownerRepository.save(owner);
|
||||
ownerRepo.save(owner);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue