Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.gov.al.saude.rhd.model; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.persistence.Column; |
||
| 6 | import javax.persistence.Embeddable; |
||
| 7 | |||
| 8 | @Embeddable |
||
| 9 | public class CargaHorariaExigidaId implements Serializable{ |
||
| 10 | |||
| 11 | private static final long serialVersionUID = 1L; |
||
| 12 | |||
| 13 | private String classe; |
||
| 14 | private String nivel; |
||
| 15 | |||
| 16 | @Column(name = "tip_classe", nullable = false) |
||
| 17 | public String getClasse() { |
||
| 18 | return classe; |
||
| 19 | } |
||
| 20 | public void setClasse(String classe) { |
||
| 21 | this.classe = classe; |
||
| 22 | } |
||
| 23 | |||
| 24 | @Column(name = "tip_nivel", nullable = false) |
||
| 25 | public String getNivel() { |
||
| 26 | return nivel; |
||
| 27 | } |
||
| 28 | public void setNivel(String nivel) { |
||
| 29 | this.nivel = nivel; |
||
| 30 | } |
||
| 31 | |||
| 32 | @Override |
||
| 33 | public int hashCode() { |
||
| 34 | final int prime = 31; |
||
| 35 | int result = 1; |
||
| 36 | result = prime * result |
||
| 37 | + ((classe == null) ? 0 : classe.hashCode()); |
||
| 38 | result = prime * result |
||
| 39 | + ((nivel == null) ? 0 : nivel |
||
| 40 | .hashCode()); |
||
| 41 | return result; |
||
| 42 | } |
||
| 43 | |||
| 44 | @Override |
||
| 45 | public boolean equals(Object obj) { |
||
| 46 | if (this == obj) |
||
| 47 | return true; |
||
| 48 | if (obj == null) |
||
| 49 | return false; |
||
| 50 | if (getClass() != obj.getClass()) |
||
| 51 | return false; |
||
| 52 | CargaHorariaExigidaId other = (CargaHorariaExigidaId) obj; |
||
| 53 | if (classe == null) { |
||
| 54 | if (other.classe != null) |
||
| 55 | return false; |
||
| 56 | } else if (!classe.equals(other.classe)) |
||
| 57 | return false; |
||
| 58 | if (nivel == null) { |
||
| 59 | if (other.nivel != null) |
||
| 60 | return false; |
||
| 61 | } else if (!nivel.equals(other.nivel)) |
||
| 62 | return false; |
||
| 63 | return true; |
||
| 64 | } |
||
| 65 | |||
| 66 | } |