Rev 325 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 325 | 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 org.hibernate.validator.constraints.NotEmpty; |
||
| 14 | |||
| 15 | import br.com.ec.core.interfaces.Alterar; |
||
| 16 | import br.com.ec.core.interfaces.Cadastrar; |
||
| 17 | import br.com.ec.core.util.StringUtil; |
||
| 18 | |||
| 19 | @Entity |
||
| 20 | @Table(name="sec_tema_estampa", schema="sc_sec") |
||
| 21 | public class TemaEstampa implements Serializable { |
||
| 22 | |||
| 23 | private static final long serialVersionUID = 1L; |
||
| 24 | |||
| 25 | private Long sequencial; |
||
| 26 | private String descricao; |
||
| 27 | private String codigo; |
||
| 28 | private Boolean ativo; |
||
| 29 | |||
| 30 | public TemaEstampa() {} |
||
| 31 | |||
| 32 | public TemaEstampa(Long sequencial) { |
||
| 33 | this.sequencial = sequencial; |
||
| 34 | } |
||
| 35 | |||
| 36 | @Id |
||
| 37 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
||
| 38 | @Column(name="seq_temaestampa", nullable=false) |
||
| 39 | public Long getSequencial() { |
||
| 40 | return sequencial; |
||
| 41 | } |
||
| 42 | public void setSequencial(Long sequencial) { |
||
| 43 | this.sequencial = sequencial; |
||
| 44 | } |
||
| 45 | |||
| 46 | @Column(name="dsc_temaestampa") |
||
| 47 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Descrição") |
||
| 48 | @NotEmpty(message="Obrigatório informar a descrição", groups={Cadastrar.class, Alterar.class}) |
||
| 49 | public String getDescricao() { |
||
| 50 | return descricao; |
||
| 51 | } |
||
| 52 | public void setDescricao(String descricao) { |
||
| 53 | this.descricao = StringUtil.setarUpperCaseComTrim(descricao); |
||
| 54 | } |
||
| 55 | |||
| 56 | @Column(name="cod_temaestampa") |
||
| 543 | blopes | 57 | @Size(max = 10, message = "Limite de caracteres ultrapassado: Código do Tema") |
| 325 | espaco | 58 | @NotEmpty(message="Obrigatório informar o código", groups={Cadastrar.class, Alterar.class}) |
| 59 | public String getCodigo() { |
||
| 60 | return codigo; |
||
| 61 | } |
||
| 62 | public void setCodigo(String codigo) { |
||
| 63 | this.codigo = StringUtil.setarUpperCaseComTrim(codigo); |
||
| 64 | } |
||
| 65 | |||
| 66 | @Column(name="ind_ativo") |
||
| 67 | public Boolean getAtivo() { |
||
| 68 | return ativo; |
||
| 69 | } |
||
| 70 | public void setAtivo(Boolean ativo) { |
||
| 71 | this.ativo = ativo; |
||
| 72 | } |
||
| 73 | |||
| 74 | @Override |
||
| 75 | public int hashCode() { |
||
| 76 | final int prime = 31; |
||
| 77 | int result = 1; |
||
| 78 | result = prime * result + ((sequencial == null) ? 0 : sequencial.hashCode()); |
||
| 79 | return result; |
||
| 80 | } |
||
| 81 | |||
| 82 | @Override |
||
| 83 | public boolean equals(Object obj) { |
||
| 84 | if (this == obj) |
||
| 85 | return true; |
||
| 86 | if (obj == null) |
||
| 87 | return false; |
||
| 88 | if (getClass() != obj.getClass()) |
||
| 89 | return false; |
||
| 90 | TemaEstampa other = (TemaEstampa) obj; |
||
| 91 | if (sequencial == null) { |
||
| 92 | if (other.sequencial != null) |
||
| 93 | return false; |
||
| 94 | } else if (!sequencial.equals(other.sequencial)) |
||
| 95 | return false; |
||
| 96 | return true; |
||
| 97 | } |
||
| 98 | |||
| 99 | } |