Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.edu.cesmac.sic.controller.beans; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.annotation.PostConstruct; |
||
| 6 | import javax.inject.Inject; |
||
| 7 | import javax.inject.Named; |
||
| 8 | |||
| 9 | import org.springframework.context.annotation.Scope; |
||
| 10 | |||
| 11 | import br.edu.cesmac.core.consulta.ParametrosConsulta; |
||
| 12 | import br.edu.cesmac.core.generic.GenericService; |
||
| 13 | import br.edu.cesmac.sic.controller.beans.consultademanda.PessoaConsultaPorDemanda; |
||
| 14 | import br.edu.cesmac.sic.core.domain.service.PessoaViewService; |
||
| 15 | import br.edu.cesmac.views.PessoaView; |
||
| 16 | import br.edu.cesmac.web.generic.AbstractBean; |
||
| 17 | |||
| 18 | @Named |
||
| 19 | @Scope("view") |
||
| 20 | public class PessoaViewBean extends AbstractBean<PessoaView> implements Serializable { |
||
| 21 | |||
| 22 | private static final long serialVersionUID = 1L; |
||
| 23 | |||
| 24 | private PessoaConsultaPorDemanda lazy; |
||
| 25 | private PessoaViewService pessoaService; |
||
| 26 | |||
| 27 | @Inject |
||
| 28 | public PessoaViewBean(PessoaConsultaPorDemanda lazy, PessoaViewService pessoaService) { |
||
| 29 | this.lazy = lazy; |
||
| 30 | this.pessoaService = pessoaService; |
||
| 31 | } |
||
| 32 | |||
| 33 | @Override |
||
| 34 | public PessoaView getId() { |
||
| 35 | return getEntidade(); |
||
| 36 | } |
||
| 37 | |||
| 38 | @Override |
||
| 39 | public GenericService<PessoaView> getService() { |
||
| 40 | return pessoaService; |
||
| 41 | } |
||
| 42 | |||
| 43 | @Override |
||
| 44 | public void limparEntidade() { |
||
| 45 | setEntidade(new PessoaView()); |
||
| 46 | } |
||
| 47 | |||
| 48 | @Override |
||
| 49 | public PessoaView getEntidade() { |
||
| 50 | return entidade; |
||
| 51 | } |
||
| 52 | |||
| 53 | public PessoaConsultaPorDemanda getLazy() { |
||
| 54 | return lazy; |
||
| 55 | } |
||
| 56 | |||
| 57 | public void prepararConsultaDemanda() { |
||
| 58 | lazy.setarParametrosConsulta(getParametrosConsulta()); |
||
| 59 | } |
||
| 60 | |||
| 61 | @PostConstruct |
||
| 62 | public void preCarregamento() { |
||
| 63 | parametrosConsulta = new ParametrosConsulta<PessoaView>(); |
||
| 64 | parametrosConsulta.setEntidade(new PessoaView()); |
||
| 65 | prepararConsultaDemanda(); |
||
| 66 | } |
||
| 67 | |||
| 68 | public void limparParametrosConsulta() { |
||
| 69 | preCarregamento(); |
||
| 70 | } |
||
| 71 | |||
| 72 | } |