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