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 | |||
| 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.AberturaLojaConsultaPorDemanda; |
||
| 195 | espaco | 11 | import br.com.ec.core.consulta.ParametrosConsulta; |
| 12 | import br.com.ec.core.generic.GenericService; |
||
| 13 | import br.com.ec.core.util.VerificadorUtil; |
||
| 106 | espaco | 14 | import br.com.ec.domain.model.AberturaLoja; |
| 15 | import br.com.ec.domain.service.aberturaloja.AberturaLojaService; |
||
| 195 | espaco | 16 | import br.com.ec.web.generic.AbstractBean; |
| 106 | espaco | 17 | |
| 18 | @Named |
||
| 19 | @Scope("view") |
||
| 20 | public class AberturaLojaBean extends AbstractBean<AberturaLoja> implements Serializable { |
||
| 21 | |||
| 22 | private static final long serialVersionUID = 1L; |
||
| 23 | |||
| 24 | private AberturaLojaConsultaPorDemanda lazy; |
||
| 25 | |||
| 26 | private AberturaLojaService aberturaLojaService; |
||
| 27 | |||
| 28 | @Inject |
||
| 29 | public AberturaLojaBean(AberturaLojaService aberturaLojaService, AberturaLojaConsultaPorDemanda lazy) { |
||
| 30 | this.aberturaLojaService = aberturaLojaService; |
||
| 31 | this.lazy = lazy; |
||
| 32 | } |
||
| 33 | |||
| 34 | @Override |
||
| 35 | public void preCarregamento() { |
||
| 36 | if (VerificadorUtil.estaNulo(parametrosConsulta)) { |
||
| 37 | entidade = new AberturaLoja(); |
||
| 38 | parametrosConsulta = new ParametrosConsulta<AberturaLoja>(); |
||
| 39 | parametrosConsulta.setEntidade(entidade); |
||
| 40 | prepararConsultaDemanda(); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | @Override |
||
| 45 | public void limparEntidade() { |
||
| 46 | AberturaLoja loja = new AberturaLoja(); |
||
| 47 | setEntidade(loja); |
||
| 48 | } |
||
| 49 | |||
| 50 | @Override |
||
| 51 | public GenericService<AberturaLoja> getService() { |
||
| 52 | return aberturaLojaService; |
||
| 53 | } |
||
| 54 | |||
| 55 | @Override |
||
| 56 | public AberturaLoja getEntidade() { |
||
| 57 | return entidade; |
||
| 58 | } |
||
| 59 | |||
| 60 | @Override |
||
| 61 | public AberturaLoja getId() { |
||
| 62 | return getEntidade(); |
||
| 63 | } |
||
| 64 | |||
| 65 | public AberturaLojaConsultaPorDemanda getLazy() { |
||
| 66 | return lazy; |
||
| 67 | } |
||
| 68 | public void setLazy(AberturaLojaConsultaPorDemanda lazy) { |
||
| 69 | this.lazy = lazy; |
||
| 70 | } |
||
| 71 | public void prepararConsultaDemanda() { |
||
| 72 | lazy.setarParametrosConsulta(getParametrosConsulta()); |
||
| 73 | } |
||
| 74 | |||
| 75 | } |