Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.gov.al.saude.rhd.model.view; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.Date; |
||
| 5 | |||
| 6 | import javax.persistence.Column; |
||
| 7 | import javax.persistence.Entity; |
||
| 8 | import javax.persistence.Id; |
||
| 9 | import javax.persistence.JoinColumn; |
||
| 10 | import javax.persistence.ManyToOne; |
||
| 11 | import javax.persistence.OneToOne; |
||
| 12 | import javax.persistence.Table; |
||
| 13 | import javax.persistence.Transient; |
||
| 14 | |||
| 15 | import org.hibernate.annotations.ForeignKey; |
||
| 16 | |||
| 17 | import br.gov.al.saude.framework.core.util.VerificadorUtil; |
||
| 18 | import br.gov.al.saude.srv.model.TipoClasseCarreira; |
||
| 19 | import br.gov.al.saude.srv.model.TipoNivelCarreira; |
||
| 20 | |||
| 21 | @Entity |
||
| 22 | @Table(name = "vw_servidor_dadofuncional", schema = "sc_srv") |
||
| 23 | public class ServidorDadoFuncionalView implements Serializable { |
||
| 24 | |||
| 25 | private static final long serialVersionUID = 1L; |
||
| 26 | |||
| 27 | private ServidorView servidorView; |
||
| 28 | |||
| 29 | private Long sequencial; |
||
| 30 | private Long numeroMatricula; |
||
| 31 | private Integer numeroDigitoMatricula; |
||
| 32 | private Date dataAdmissao; |
||
| 33 | private Date dataExercicio; |
||
| 34 | private UnidadeView unidadeExercicio; |
||
| 35 | private String descricaoUnidadeExercicio; |
||
| 36 | private String descricaoUnidadeLotacao; |
||
| 37 | private String descricaoOrgaoOrigem; |
||
| 38 | private String descricaoOrgaoLotacao; |
||
| 39 | private String descricaoTipoServidor; |
||
| 40 | private String descricaoSituacaoServidor; |
||
| 41 | private String descricaoCargo; |
||
| 42 | private String tipoNivelCargo; |
||
| 43 | private String descricaoCarreira; |
||
| 44 | private String tipoNivelCarreira; |
||
| 45 | private String tipoClasseCarreira; |
||
| 46 | private String descricaoSetor; |
||
| 47 | private String descricaoFuncao; |
||
| 48 | |||
| 49 | public ServidorDadoFuncionalView() {} |
||
| 50 | |||
| 51 | |||
| 52 | public ServidorDadoFuncionalView(ServidorView servidor) { |
||
| 53 | this.servidorView = servidor; |
||
| 54 | } |
||
| 55 | |||
| 56 | public ServidorDadoFuncionalView(Long sequencial, Long numeroMatricula, Integer numeroDigitoMatricula, String nomeServidor, Long sequencialPessoa){ |
||
| 57 | this.sequencial = sequencial; |
||
| 58 | this.numeroMatricula = numeroMatricula; |
||
| 59 | this.numeroDigitoMatricula = numeroDigitoMatricula; |
||
| 60 | this.servidorView = new ServidorView(nomeServidor, sequencialPessoa); |
||
| 61 | } |
||
| 62 | |||
| 63 | @Id |
||
| 64 | @Column(name="seq_servidor_dadofuncional", nullable=false) |
||
| 65 | public Long getSequencial() { |
||
| 66 | return sequencial; |
||
| 67 | } |
||
| 68 | |||
| 69 | public void setSequencial(Long sequencial) { |
||
| 70 | this.sequencial = sequencial; |
||
| 71 | } |
||
| 72 | |||
| 73 | @ManyToOne |
||
| 74 | @ForeignKey(name="fk_servidor_dadofuncional") |
||
| 75 | @JoinColumn(name="seq_pessoa_servidor", referencedColumnName="seq_pessoa_servidor") |
||
| 76 | public ServidorView getServidorView() { |
||
| 77 | return servidorView; |
||
| 78 | } |
||
| 79 | |||
| 80 | public void setServidorView(ServidorView servidorView) { |
||
| 81 | this.servidorView = servidorView; |
||
| 82 | } |
||
| 83 | |||
| 84 | @Column(name="num_matricula_servidor", nullable=false) |
||
| 85 | public Long getNumeroMatricula() { |
||
| 86 | return numeroMatricula; |
||
| 87 | } |
||
| 88 | |||
| 89 | public void setNumeroMatricula(Long numeroMatricula) { |
||
| 90 | this.numeroMatricula = numeroMatricula; |
||
| 91 | } |
||
| 92 | |||
| 93 | @Column(name="num_digito_matricula", nullable=false) |
||
| 94 | public Integer getNumeroDigitoMatricula() { |
||
| 95 | return numeroDigitoMatricula; |
||
| 96 | } |
||
| 97 | |||
| 98 | public void setNumeroDigitoMatricula(Integer numeroDigitoMatricula) { |
||
| 99 | this.numeroDigitoMatricula = numeroDigitoMatricula; |
||
| 100 | } |
||
| 101 | |||
| 102 | @Column(name="dat_admissao") |
||
| 103 | public Date getDataAdmissao() { |
||
| 104 | return dataAdmissao; |
||
| 105 | } |
||
| 106 | public void setDataAdmissao(Date dataAdmissao) { |
||
| 107 | this.dataAdmissao = dataAdmissao; |
||
| 108 | } |
||
| 109 | |||
| 110 | @Column(name="dat_exercicio") |
||
| 111 | public Date getDataExercicio() { |
||
| 112 | return dataExercicio; |
||
| 113 | } |
||
| 114 | |||
| 115 | public void setDataExercicio(Date dataExercicio) { |
||
| 116 | this.dataExercicio = dataExercicio; |
||
| 117 | } |
||
| 118 | |||
| 119 | @OneToOne |
||
| 120 | @JoinColumn(name="cod_unidade_exercicio") |
||
| 121 | public UnidadeView getUnidadeExercicio() { |
||
| 122 | return unidadeExercicio; |
||
| 123 | } |
||
| 124 | |||
| 125 | public void setUnidadeExercicio(UnidadeView unidadeExercicio) { |
||
| 126 | this.unidadeExercicio = unidadeExercicio; |
||
| 127 | } |
||
| 128 | |||
| 129 | @Column(name="dsc_unidade_exercicio") |
||
| 130 | public String getDescricaoUnidadeExercicio() { |
||
| 131 | return descricaoUnidadeExercicio; |
||
| 132 | } |
||
| 133 | |||
| 134 | public void setDescricaoUnidadeExercicio(String descricaoUnidadeExercicio) { |
||
| 135 | this.descricaoUnidadeExercicio = descricaoUnidadeExercicio; |
||
| 136 | } |
||
| 137 | |||
| 138 | @Column(name="dsc_unidade_lotacao") |
||
| 139 | public String getDescricaoUnidadeLotacao() { |
||
| 140 | return descricaoUnidadeLotacao; |
||
| 141 | } |
||
| 142 | |||
| 143 | public void setDescricaoUnidadeLotacao(String descricaoUnidadeLotacao) { |
||
| 144 | this.descricaoUnidadeLotacao = descricaoUnidadeLotacao; |
||
| 145 | } |
||
| 146 | |||
| 147 | @Column(name="dsc_orgao_origem") |
||
| 148 | public String getDescricaoOrgaoOrigem() { |
||
| 149 | return descricaoOrgaoOrigem; |
||
| 150 | } |
||
| 151 | |||
| 152 | public void setDescricaoOrgaoOrigem(String descricaoOrgaoOrigem) { |
||
| 153 | this.descricaoOrgaoOrigem = descricaoOrgaoOrigem; |
||
| 154 | } |
||
| 155 | |||
| 156 | @Column(name="dsc_orgao_lotacao") |
||
| 157 | public String getDescricaoOrgaoLotacao() { |
||
| 158 | return descricaoOrgaoLotacao; |
||
| 159 | } |
||
| 160 | |||
| 161 | public void setDescricaoOrgaoLotacao(String descricaoOrgaoLotacao) { |
||
| 162 | this.descricaoOrgaoLotacao = descricaoOrgaoLotacao; |
||
| 163 | } |
||
| 164 | |||
| 165 | @Column(name="dsc_tipo_servidor") |
||
| 166 | public String getDescricaoTipoServidor() { |
||
| 167 | return descricaoTipoServidor; |
||
| 168 | } |
||
| 169 | |||
| 170 | public void setDescricaoTipoServidor(String descricaoTipoServidor) { |
||
| 171 | this.descricaoTipoServidor = descricaoTipoServidor; |
||
| 172 | } |
||
| 173 | |||
| 174 | @Column(name="dsc_situacao_servidor") |
||
| 175 | public String getDescricaoSituacaoServidor() { |
||
| 176 | return descricaoSituacaoServidor; |
||
| 177 | } |
||
| 178 | |||
| 179 | public void setDescricaoSituacaoServidor(String descricaoSituacaoServidor) { |
||
| 180 | this.descricaoSituacaoServidor = descricaoSituacaoServidor; |
||
| 181 | } |
||
| 182 | |||
| 183 | @Column(name="dsc_cargo") |
||
| 184 | public String getDescricaoCargo() { |
||
| 185 | return descricaoCargo; |
||
| 186 | } |
||
| 187 | |||
| 188 | public void setDescricaoCargo(String descricaoCargo) { |
||
| 189 | this.descricaoCargo = descricaoCargo; |
||
| 190 | } |
||
| 191 | |||
| 192 | @Column(name="tip_nivel_cargo") |
||
| 193 | public String getTipoNivelCargo() { |
||
| 194 | return tipoNivelCargo; |
||
| 195 | } |
||
| 196 | |||
| 197 | public void setTipoNivelCargo(String tipoNivelCargo) { |
||
| 198 | this.tipoNivelCargo = tipoNivelCargo; |
||
| 199 | } |
||
| 200 | |||
| 201 | @Column(name="dsc_carreira") |
||
| 202 | public String getDescricaoCarreira() { |
||
| 203 | return descricaoCarreira; |
||
| 204 | } |
||
| 205 | |||
| 206 | public void setDescricaoCarreira(String descricaoCarreira) { |
||
| 207 | this.descricaoCarreira = descricaoCarreira; |
||
| 208 | } |
||
| 209 | |||
| 210 | @Column(name="tip_nivel_carreira") |
||
| 211 | public String getTipoNivelCarreira() { |
||
| 212 | return tipoNivelCarreira; |
||
| 213 | } |
||
| 214 | |||
| 215 | public void setTipoNivelCarreira(String tipoNivelCarreira) { |
||
| 216 | this.tipoNivelCarreira = tipoNivelCarreira; |
||
| 217 | } |
||
| 218 | |||
| 219 | @Column(name="tip_classe_carreira") |
||
| 220 | public String getTipoClasseCarreira() { |
||
| 221 | return tipoClasseCarreira; |
||
| 222 | } |
||
| 223 | |||
| 224 | public void setTipoClasseCarreira(String tipoClasseCarreira) { |
||
| 225 | this.tipoClasseCarreira = tipoClasseCarreira; |
||
| 226 | } |
||
| 227 | |||
| 228 | @Column(name="dsc_setor") |
||
| 229 | public String getDescricaoSetor() { |
||
| 230 | return descricaoSetor; |
||
| 231 | } |
||
| 232 | |||
| 233 | public void setDescricaoSetor(String descricaoSetor) { |
||
| 234 | this.descricaoSetor = descricaoSetor; |
||
| 235 | } |
||
| 236 | |||
| 237 | @Column(name="dsc_funcao") |
||
| 238 | public String getDescricaoFuncao() { |
||
| 239 | return descricaoFuncao; |
||
| 240 | } |
||
| 241 | |||
| 242 | public void setDescricaoFuncao(String descricaoFuncao) { |
||
| 243 | this.descricaoFuncao = descricaoFuncao; |
||
| 244 | } |
||
| 245 | |||
| 246 | @Transient |
||
| 247 | public String getDescricaoNivelCarreira() { |
||
| 248 | return VerificadorUtil.estaNulo(this.getTipoNivelCarreira())?null:TipoNivelCarreira.parse(this.getTipoNivelCarreira()).getDescricao(); |
||
| 249 | } |
||
| 250 | |||
| 251 | @Transient |
||
| 252 | public String getDescricaoClasseCarreira() { |
||
| 253 | return VerificadorUtil.estaNulo(this.getTipoClasseCarreira())?null:TipoClasseCarreira.parse(this.getTipoClasseCarreira()).getDescricao(); |
||
| 254 | } |
||
| 255 | |||
| 256 | @Override |
||
| 257 | public int hashCode() { |
||
| 258 | final int prime = 31; |
||
| 259 | int result = 1; |
||
| 260 | result = prime * result |
||
| 261 | + ((sequencial == null) ? 0 : sequencial.hashCode()); |
||
| 262 | return result; |
||
| 263 | } |
||
| 264 | |||
| 265 | @Override |
||
| 266 | public boolean equals(Object obj) { |
||
| 267 | if (this == obj) |
||
| 268 | return true; |
||
| 269 | if (obj == null) |
||
| 270 | return false; |
||
| 271 | if (getClass() != obj.getClass()) |
||
| 272 | return false; |
||
| 273 | ServidorDadoFuncionalView other = (ServidorDadoFuncionalView) obj; |
||
| 274 | if (sequencial == null) { |
||
| 275 | if (other.sequencial != null) |
||
| 276 | return false; |
||
| 277 | } else if (!sequencial.equals(other.sequencial)) |
||
| 278 | return false; |
||
| 279 | return true; |
||
| 280 | } |
||
| 281 | |||
| 282 | } |