Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | espaco | 1 | package br.com.ec.domain.service.maquineta.impl; |
| 2 | |||
| 3 | import java.util.List; |
||
| 4 | |||
| 5 | import org.springframework.beans.factory.annotation.Autowired; |
||
| 6 | import org.springframework.stereotype.Service; |
||
| 7 | |||
| 8 | import br.com.ec.domain.model.Maquineta; |
||
| 9 | import br.com.ec.domain.service.maquineta.MaquinetaService; |
||
| 10 | import br.com.ec.infrastructure.repository.MaquinetaRepository; |
||
| 11 | import br.edu.cesmac.core.generic.AbstractService; |
||
| 12 | import br.edu.cesmac.core.generic.GenericRepository; |
||
| 13 | import br.edu.cesmac.core.validador.Validador; |
||
| 14 | |||
| 15 | @Service |
||
| 16 | public class MaquinetaServiceImpl extends AbstractService<Maquineta> implements MaquinetaService { |
||
| 17 | |||
| 18 | private MaquinetaRepository maquinetaRepository; |
||
| 19 | |||
| 20 | @Autowired |
||
| 21 | public MaquinetaServiceImpl(Validador validador, MaquinetaRepository maquinetaRepository) { |
||
| 22 | super(validador); |
||
| 23 | this.maquinetaRepository = maquinetaRepository; |
||
| 24 | } |
||
| 25 | |||
| 26 | @Override |
||
| 27 | protected GenericRepository<Maquineta> getRepository() { |
||
| 28 | return maquinetaRepository; |
||
| 29 | } |
||
| 30 | |||
| 31 | @Override |
||
| 32 | protected void regrasNegocioCadastrar(Maquineta maquineta) { |
||
| 33 | maquineta.setAtivo(true); |
||
| 34 | } |
||
| 35 | |||
| 36 | @Override |
||
| 37 | public List<Maquineta> listarMaquinetasAtivas() { |
||
| 38 | Maquineta maquinetaSelecionada = new Maquineta(); |
||
| 39 | maquinetaSelecionada.setAtivo(true); |
||
| 40 | return this.consultarPassandoEntidade(maquinetaSelecionada, 0, this.obterQuantidadeDeRegistrosPassandoEntidade(maquinetaSelecionada)); |
||
| 41 | } |
||
| 42 | |||
| 43 | } |