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.sac.shared.views.CursoView; |
||
| 14 | import br.edu.cesmac.sic.controller.beans.consultademanda.CursoConsultaPorDemanda; |
||
| 15 | import br.edu.cesmac.sic.core.domain.service.CursoService; |
||
| 16 | import br.edu.cesmac.web.generic.AbstractBean; |
||
| 17 | |||
| 18 | @Named |
||
| 19 | @Scope("view") |
||
| 20 | public class CursoBean extends AbstractBean<CursoView> implements Serializable { |
||
| 21 | |||
| 22 | private static final long serialVersionUID = 1L; |
||
| 23 | |||
| 24 | private CursoService cursoService; |
||
| 25 | |||
| 26 | private CursoConsultaPorDemanda lazy; |
||
| 27 | |||
| 28 | @Inject |
||
| 29 | public CursoBean(CursoConsultaPorDemanda lazy, CursoService cursoService) { |
||
| 30 | this.lazy = lazy; |
||
| 31 | this.cursoService = cursoService; |
||
| 32 | } |
||
| 33 | |||
| 34 | @Override |
||
| 35 | public CursoView getId() { |
||
| 36 | return getEntidade(); |
||
| 37 | } |
||
| 38 | |||
| 39 | @Override |
||
| 40 | public GenericService<CursoView> getService() { |
||
| 41 | return cursoService; |
||
| 42 | } |
||
| 43 | |||
| 44 | @Override |
||
| 45 | public void limparEntidade() { |
||
| 46 | setEntidade(new CursoView()); |
||
| 47 | } |
||
| 48 | |||
| 49 | public CursoConsultaPorDemanda getLazy() { |
||
| 50 | return lazy; |
||
| 51 | } |
||
| 52 | |||
| 53 | public void prepararConsultaDemanda() { |
||
| 54 | lazy.setarParametrosConsulta(getParametrosConsulta()); |
||
| 55 | } |
||
| 56 | |||
| 57 | @PostConstruct |
||
| 58 | public void preCarregamento() { |
||
| 59 | parametrosConsulta = new ParametrosConsulta(); |
||
| 60 | parametrosConsulta.setEntidade(new CursoView()); |
||
| 61 | prepararConsultaDemanda(); |
||
| 62 | } |
||
| 63 | |||
| 64 | public void limparParametrosConsulta() { |
||
| 65 | preCarregamento(); |
||
| 66 | } |
||
| 67 | |||
| 68 | } |