Rev 259 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 259 | espaco | 1 | package br.com.ec.domain.model; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.persistence.Column; |
||
| 6 | import javax.persistence.Entity; |
||
| 7 | import javax.persistence.GeneratedValue; |
||
| 8 | import javax.persistence.GenerationType; |
||
| 9 | import javax.persistence.Id; |
||
| 10 | import javax.persistence.Table; |
||
| 11 | import javax.validation.constraints.Size; |
||
| 12 | |||
| 13 | import br.com.ec.core.util.StringUtil; |
||
| 14 | |||
| 15 | @Entity |
||
| 16 | @Table(name="sec_perfil", schema="sc_sec") |
||
| 17 | public class Perfil implements Serializable { |
||
| 18 | |||
| 19 | private static final long serialVersionUID = 1L; |
||
| 20 | |||
| 21 | private Long codigo; |
||
| 22 | private String descricao; |
||
| 23 | private String descricaoSetor; |
||
| 24 | private Boolean ativoSetor; |
||
| 25 | |||
| 26 | public Perfil(){} |
||
| 27 | |||
| 325 | espaco | 28 | public Perfil(Long codigo) { |
| 259 | espaco | 29 | this.codigo = codigo; |
| 30 | } |
||
| 31 | |||
| 32 | @Id |
||
| 33 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
||
| 34 | @Column(name="cod_perfil", nullable=false) |
||
| 35 | public Long getCodigo() { |
||
| 36 | return codigo; |
||
| 37 | } |
||
| 38 | public void setCodigo(Long codigo) { |
||
| 39 | this.codigo = codigo; |
||
| 40 | } |
||
| 41 | |||
| 42 | @Column(name="dsc_perfil") |
||
| 43 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Descrição") |
||
| 44 | public String getDescricao() { |
||
| 45 | return descricao; |
||
| 46 | } |
||
| 47 | public void setDescricao(String descricao) { |
||
| 48 | this.descricao = StringUtil.setarUpperCaseComTrim(descricao); |
||
| 49 | } |
||
| 50 | |||
| 51 | @Column(name="dsc_setor") |
||
| 52 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Descrição do Setor") |
||
| 53 | public String getDescricaoSetor() { |
||
| 54 | return descricaoSetor; |
||
| 55 | } |
||
| 56 | public void setDescricaoSetor(String descricaoSetor) { |
||
| 57 | this.descricaoSetor = descricaoSetor; |
||
| 58 | } |
||
| 59 | |||
| 60 | @Column(name="ind_setor_ativo") |
||
| 61 | public Boolean getAtivoSetor() { |
||
| 62 | return ativoSetor; |
||
| 63 | } |
||
| 64 | public void setAtivoSetor(Boolean ativoSetor) { |
||
| 65 | this.ativoSetor = ativoSetor; |
||
| 66 | } |
||
| 67 | |||
| 68 | @Override |
||
| 69 | public int hashCode() { |
||
| 70 | final int prime = 31; |
||
| 71 | int result = 1; |
||
| 72 | result = prime * result + ((codigo == null) ? 0 : codigo.hashCode()); |
||
| 73 | return result; |
||
| 74 | } |
||
| 75 | |||
| 76 | @Override |
||
| 77 | public boolean equals(Object obj) { |
||
| 78 | if (this == obj) |
||
| 79 | return true; |
||
| 80 | if (obj == null) |
||
| 81 | return false; |
||
| 82 | if (getClass() != obj.getClass()) |
||
| 83 | return false; |
||
| 84 | Perfil other = (Perfil) obj; |
||
| 85 | if (codigo == null) { |
||
| 86 | if (other.codigo != null) |
||
| 87 | return false; |
||
| 88 | } else if (!codigo.equals(other.codigo)) |
||
| 89 | return false; |
||
| 90 | return true; |
||
| 91 | } |
||
| 92 | |||
| 93 | |||
| 94 | } |