Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.edu.cesmac.sic.core.domain.model; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.persistence.Column; |
||
| 6 | import javax.persistence.Entity; |
||
| 7 | import javax.persistence.Id; |
||
| 8 | import javax.persistence.Table; |
||
| 9 | |||
| 10 | @Entity |
||
| 11 | @Table(name="sic_area", schema="admsic001") |
||
| 12 | public class Area implements Serializable { |
||
| 13 | |||
| 14 | private static final long serialVersionUID = 1L; |
||
| 15 | |||
| 16 | private Integer codigo; |
||
| 17 | private String descricao; |
||
| 18 | |||
| 19 | @Id |
||
| 20 | @Column(name="cod_area", nullable=false) |
||
| 21 | public Integer getCodigo() { |
||
| 22 | return codigo; |
||
| 23 | } |
||
| 24 | |||
| 25 | public void setCodigo(Integer codigo) { |
||
| 26 | this.codigo = codigo; |
||
| 27 | } |
||
| 28 | |||
| 29 | @Column(name="dsc_area", nullable=false) |
||
| 30 | public String getDescricao() { |
||
| 31 | return descricao; |
||
| 32 | } |
||
| 33 | |||
| 34 | public void setDescricao(String descricao) { |
||
| 35 | this.descricao = descricao; |
||
| 36 | } |
||
| 37 | |||
| 38 | @Override |
||
| 39 | public int hashCode() { |
||
| 40 | final int prime = 31; |
||
| 41 | int result = 1; |
||
| 42 | result = prime * result + ((codigo == null) ? 0 : codigo.hashCode()); |
||
| 43 | return result; |
||
| 44 | } |
||
| 45 | |||
| 46 | @Override |
||
| 47 | public boolean equals(Object obj) { |
||
| 48 | if (this == obj) |
||
| 49 | return true; |
||
| 50 | if (obj == null) |
||
| 51 | return false; |
||
| 52 | if (getClass() != obj.getClass()) |
||
| 53 | return false; |
||
| 54 | Area other = (Area) obj; |
||
| 55 | if (codigo == null) { |
||
| 56 | if (other.codigo != null) |
||
| 57 | return false; |
||
| 58 | } else if (!codigo.equals(other.codigo)) |
||
| 59 | return false; |
||
| 60 | return true; |
||
| 61 | } |
||
| 62 | |||
| 63 | } |