source: src/main/java/com/example/baza/service/impl/DobavuvavServiceImpl.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: 1.1 KB
Line 
1package com.example.baza.service.impl;
2
3import com.example.baza.model.Dobavuvac;
4import com.example.baza.repository.DobavuvacRepository;
5import com.example.baza.service.DobavuvacService;
6import org.springframework.stereotype.Service;
7
8import java.util.List;
9import java.util.Optional;
10
11@Service
12public 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.