Rev 259 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 259 | Rev 325 | ||
|---|---|---|---|
| Line 27... | Line 27... | ||
| 27 | 27 | ||
| 28 | import br.com.ec.core.interfaces.Alterar; |
28 | import br.com.ec.core.interfaces.Alterar; |
| 29 | import br.com.ec.core.interfaces.Cadastrar; |
29 | import br.com.ec.core.interfaces.Cadastrar; |
| 30 | import br.com.ec.core.util.StringUtil; |
30 | import br.com.ec.core.util.StringUtil; |
| 31 | import br.com.ec.core.util.VerificadorUtil; |
31 | import br.com.ec.core.util.VerificadorUtil; |
| - | 32 | import br.com.ec.domain.dto.UsuarioDTO; |
|
| 32 | 33 | ||
| 33 | @Entity |
34 | @Entity |
| 34 | @Table(name="sec_usuario", schema="sc_sec") |
35 | @Table(name="sec_usuario", schema="sc_sec") |
| 35 | public class Usuario implements Serializable { |
36 | public class Usuario implements Serializable { |
| 36 | 37 | ||
| Line 47... | Line 48... | ||
| 47 | private List<UsuarioPerfil> perfis; |
48 | private List<UsuarioPerfil> perfis; |
| 48 | private List<UsuarioLoja> lojas; |
49 | private List<UsuarioLoja> lojas; |
| 49 | 50 | ||
| 50 | // private List<Parametro> parametros;
|
51 | // private List<Parametro> parametros;
|
| 51 | 52 | ||
| - | 53 | public Usuario() {} |
|
| - | 54 | ||
| - | 55 | public Usuario(Long sequencial) { |
|
| - | 56 | this.sequencial = sequencial; |
|
| - | 57 | }
|
|
| - | 58 | ||
| 52 | @Id |
59 | @Id |
| 53 | @SequenceGenerator(name = "sq_usuario") |
60 | @SequenceGenerator(name = "sq_usuario") |
| 54 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
61 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 55 | @Column(name="seq_usuario", nullable=false) |
62 | @Column(name="seq_usuario", nullable=false) |
| 56 | public Long getSequencial() { |
63 | public Long getSequencial() { |
| Line 158... | Line 165... | ||
| 158 | 165 | ||
| 159 | @Transient |
166 | @Transient |
| 160 | public String getCaminhoPastaFotos() { |
167 | public String getCaminhoPastaFotos() { |
| 161 | ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); |
168 | ServletContext servletContext = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext(); |
| 162 | return servletContext.getRealPath("") + File.separator + "imagens" + File.separator + "usuarios" + File.separator; |
169 | return servletContext.getRealPath("") + File.separator + "imagens" + File.separator + "usuarios" + File.separator; |
| - | 170 | }
|
|
| - | 171 | ||
| - | 172 | public void atualizarDados(UsuarioDTO usuarioDTO) { |
|
| - | 173 | this.nome = usuarioDTO.getNome(); |
|
| - | 174 | this.login = usuarioDTO.getLogin(); |
|
| - | 175 | // this.senha = usuarioDTO.getSenha();
|
|
| 163 | }
|
176 | }
|
| 164 | 177 | ||
| 165 | }
|
178 | }
|