source: src/main/java/com/example/baza/service/impl/AvtorServiceImpl.java

Last change on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 962 bytes
Line 
1package com.example.baza.service.impl;
2
3
4import com.example.baza.model.Avtor;
5import com.example.baza.repository.AvtorRepository;
6import com.example.baza.service.AvtorService;
7import org.springframework.stereotype.Service;
8
9import java.util.List;
10import java.util.Optional;
11
12@Service
13public class AvtorServiceImpl implements AvtorService {
14 private final AvtorRepository avtorRepository;
15
16 public AvtorServiceImpl(AvtorRepository avtorRepository) {
17 this.avtorRepository = avtorRepository;
18 }
19
20 @Override
21 public List<Avtor> findAll() {
22 return this.avtorRepository.findAll();
23 }
24
25 @Override
26 public List<Avtor> findByImeLike(String ime) {
27 return this.avtorRepository.findByImeLike(ime);
28 }
29
30 @Override
31 public Optional<Avtor> findById(Integer id) {
32 return this.avtorRepository.findById(id);
33 }
34
35 @Override
36 public void delete(Integer id) {
37 this.avtorRepository.deleteById(id);
38 }
39}
Note: See TracBrowser for help on using the repository browser.