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