Rev 106 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | espaco | 1 | package br.com.ec.controller.managedbean; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.List; |
||
| 5 | |||
| 6 | import javax.inject.Inject; |
||
| 7 | import javax.inject.Named; |
||
| 8 | |||
| 9 | import org.springframework.context.annotation.Scope; |
||
| 10 | |||
| 195 | espaco | 11 | import br.com.ec.core.consulta.ParametrosConsulta; |
| 12 | import br.com.ec.core.generic.GenericService; |
||
| 106 | espaco | 13 | import br.com.ec.domain.model.EmpresaAdquirente; |
| 14 | import br.com.ec.domain.service.empresaadquirente.EmpresaAdquirenteService; |
||
| 195 | espaco | 15 | import br.com.ec.web.generic.AbstractBean; |
| 106 | espaco | 16 | |
| 17 | @Named |
||
| 18 | @Scope("view") |
||
| 19 | public class EmpresaAdquirenteBean extends AbstractBean<EmpresaAdquirente> implements Serializable { |
||
| 20 | |||
| 21 | private static final long serialVersionUID = 1L; |
||
| 22 | |||
| 23 | private EmpresaAdquirenteService empresaAdquirenteService; |
||
| 24 | |||
| 25 | private EmpresaAdquirente empresaAdquirenteSelecionada; |
||
| 26 | |||
| 27 | @Inject |
||
| 28 | public EmpresaAdquirenteBean(EmpresaAdquirenteService empresaAdquirenteService) { |
||
| 29 | this.empresaAdquirenteService = empresaAdquirenteService; |
||
| 30 | } |
||
| 31 | |||
| 32 | @Override |
||
| 33 | public void preCarregamento() { |
||
| 34 | entidade = new EmpresaAdquirente(); |
||
| 35 | parametrosConsulta = new ParametrosConsulta<EmpresaAdquirente>(); |
||
| 36 | parametrosConsulta.setEntidade(entidade); |
||
| 37 | } |
||
| 38 | |||
| 39 | @Override |
||
| 40 | public void limparEntidade() { |
||
| 41 | EmpresaAdquirente empresaAdquirente = new EmpresaAdquirente(); |
||
| 42 | setEntidade(empresaAdquirente); |
||
| 43 | } |
||
| 44 | |||
| 45 | @Override |
||
| 46 | public GenericService<EmpresaAdquirente> getService() { |
||
| 47 | return empresaAdquirenteService; |
||
| 48 | } |
||
| 49 | |||
| 50 | @Override |
||
| 51 | public EmpresaAdquirente getEntidade() { |
||
| 52 | return entidade; |
||
| 53 | } |
||
| 54 | |||
| 55 | @Override |
||
| 56 | public EmpresaAdquirente getId() { |
||
| 57 | return getEntidade(); |
||
| 58 | } |
||
| 59 | |||
| 60 | public EmpresaAdquirente getEmpresaAdquirenteSelecionada() { |
||
| 61 | return empresaAdquirenteSelecionada; |
||
| 62 | } |
||
| 63 | public void setEmpresaAdquirenteSelecionada(EmpresaAdquirente empresaAdquirenteSelecionada) { |
||
| 64 | this.empresaAdquirenteSelecionada = empresaAdquirenteSelecionada; |
||
| 65 | } |
||
| 66 | |||
| 67 | public List<EmpresaAdquirente> listarEmpresasAdquirentesAtivas() { |
||
| 68 | return empresaAdquirenteService.listarEmpresasAdquirentesAtivas(); |
||
| 69 | } |
||
| 70 | |||
| 71 | public List<EmpresaAdquirente> listarEmpresaAdquirentes() { |
||
| 72 | return empresaAdquirenteService.consultarTodos(new EmpresaAdquirente()); |
||
| 73 | } |
||
| 74 | |||
| 75 | } |