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 | |
---|
1 | package com.example.baza.service.impl;
|
---|
2 |
|
---|
3 |
|
---|
4 | import com.example.baza.model.Avtor;
|
---|
5 | import com.example.baza.repository.AvtorRepository;
|
---|
6 | import com.example.baza.service.AvtorService;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 | import java.util.Optional;
|
---|
11 |
|
---|
12 | @Service
|
---|
13 | public 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.