Last change
on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package com.example.baza.service.impl;
|
---|
2 |
|
---|
3 | import com.example.baza.model.Dobavuvac;
|
---|
4 | import com.example.baza.repository.DobavuvacRepository;
|
---|
5 | import com.example.baza.service.DobavuvacService;
|
---|
6 | import org.springframework.stereotype.Service;
|
---|
7 |
|
---|
8 | import java.util.List;
|
---|
9 | import java.util.Optional;
|
---|
10 |
|
---|
11 | @Service
|
---|
12 | public class DobavuvavServiceImpl implements DobavuvacService {
|
---|
13 | private final DobavuvacRepository dobavuvacRepository;
|
---|
14 |
|
---|
15 | public DobavuvavServiceImpl(DobavuvacRepository dobavuvacRepository) {
|
---|
16 | this.dobavuvacRepository = dobavuvacRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public Optional<Dobavuvac> findById(Integer id) {
|
---|
21 | return this.dobavuvacRepository.findById(id);
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public List<Dobavuvac> findByImeDobabuvac(String imeDobabuvac) {
|
---|
26 | return this.dobavuvacRepository.findByImeNaDobavuvac(imeDobabuvac);
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public Dobavuvac create(String imeDobabuvac) {
|
---|
31 | return this.dobavuvacRepository.save(new Dobavuvac(imeDobabuvac));
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | public void delete(Integer id) {
|
---|
36 | this.dobavuvacRepository.deleteById(id);
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.