source:
Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java@
eac569a
Last change on this file since eac569a was eac569a, checked in by , 16 months ago | |
---|---|
|
|
File size: 751 bytes |
Rev | Line | |
---|---|---|
[55c0119] | 1 | package finki.paw5.service.implementation; |
2 | ||
[468b7b6] | 3 | import finki.paw5.model.entities.Pet; |
[988f3fa] | 4 | import finki.paw5.repository.PetRepository; |
[55c0119] | 5 | import finki.paw5.service.PetService; |
6 | import org.springframework.stereotype.Service; | |
7 | ||
[a762b3a] | 8 | import java.util.List; |
9 | ||
[55c0119] | 10 | @Service |
11 | public class PetServiceImplementation implements PetService { | |
[988f3fa] | 12 | |
13 | private final PetRepository petRepository; | |
14 | ||
15 | public PetServiceImplementation(PetRepository petRepository) { | |
16 | this.petRepository = petRepository; | |
17 | } | |
18 | ||
[468b7b6] | 19 | @Override |
20 | public void save(Pet pet) { | |
21 | this.petRepository.save(pet); | |
22 | } | |
[a762b3a] | 23 | |
[7e3f2f7] | 24 | public List<Pet> listpets() {return this.petRepository.findAll();} |
[a762b3a] | 25 | |
26 | @Override | |
[4103eaa] | 27 | public Pet findById(Integer id) { |
28 | return this.petRepository.findById(id).get(); | |
[a762b3a] | 29 | } |
[988f3fa] | 30 | } |
Note:
See TracBrowser
for help on using the repository browser.