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