Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.gov.al.saude.srv.model; |
| 2 | |||
| 3 | import static br.gov.al.saude.framework.core.util.DataUtils.converterDataParaString; |
||
| 4 | import static br.gov.al.saude.framework.core.util.VerificadorUtil.estaNulo; |
||
| 5 | import static br.gov.al.saude.framework.core.util.VerificadorUtil.naoEstaNulo; |
||
| 6 | |||
| 7 | import java.io.Serializable; |
||
| 8 | import java.util.Date; |
||
| 9 | import java.util.HashSet; |
||
| 10 | import java.util.Set; |
||
| 11 | |||
| 12 | import javax.persistence.CascadeType; |
||
| 13 | import javax.persistence.Column; |
||
| 14 | import javax.persistence.Entity; |
||
| 15 | import javax.persistence.GeneratedValue; |
||
| 16 | import javax.persistence.GenerationType; |
||
| 17 | import javax.persistence.Id; |
||
| 18 | import javax.persistence.JoinColumn; |
||
| 19 | import javax.persistence.ManyToOne; |
||
| 20 | import javax.persistence.OneToMany; |
||
| 21 | import javax.persistence.OneToOne; |
||
| 22 | import javax.persistence.SequenceGenerator; |
||
| 23 | import javax.persistence.Table; |
||
| 24 | import javax.persistence.Temporal; |
||
| 25 | import javax.persistence.TemporalType; |
||
| 26 | import javax.persistence.Transient; |
||
| 27 | import javax.validation.Valid; |
||
| 28 | import javax.validation.constraints.NotNull; |
||
| 29 | |||
| 30 | import org.hibernate.envers.AuditTable; |
||
| 31 | import org.hibernate.envers.Audited; |
||
| 32 | import org.hibernate.envers.NotAudited; |
||
| 33 | import org.hibernate.envers.RelationTargetAuditMode; |
||
| 34 | |||
| 35 | import br.gov.al.saude.framework.core.generic.identidade.Identidade; |
||
| 36 | import br.gov.al.saude.framework.core.interfaces.Alterar; |
||
| 37 | import br.gov.al.saude.framework.core.interfaces.Cadastrar; |
||
| 38 | import br.gov.al.saude.srv.model.enums.TipoObjetoEventoServidor; |
||
| 39 | import br.gov.al.saude.srv.model.enums.TipoPublicacao; |
||
| 40 | import br.gov.al.saude.srv.model.enums.TipoRemocao; |
||
| 41 | import br.gov.al.saude.srv.model.enums.TipoSituacaoEvento; |
||
| 42 | |||
| 43 | @Audited |
||
| 44 | @AuditTable(value="srv_hist_evento_servdadofunc", schema="sc_srv") |
||
| 45 | @Entity |
||
| 46 | @Table(name="srv_evento_servdadofunc", schema="sc_srv") |
||
| 47 | public class EventoServidorDadoFuncional implements Serializable, Identidade { |
||
| 48 | |||
| 49 | private static final long serialVersionUID = 1L; |
||
| 50 | |||
| 51 | private Long sequencial; |
||
| 52 | private Evento evento; |
||
| 53 | private String tipoSituacaoEvento; |
||
| 54 | private ServidorDadoFuncional servidorDadoFuncional; |
||
| 55 | private Date dataEvento; |
||
| 56 | private String observacao; |
||
| 57 | private Boolean indicadorEventoRetroativo; |
||
| 58 | |||
| 59 | private Set<EventoServidorDadoFuncionalDocumento> eventoServidorDadoFuncionalDocumentos = new HashSet<EventoServidorDadoFuncionalDocumento>(); |
||
| 60 | private Set<EventoServidorDadoFuncionalExigePublicacao> eventoServidorDadoFuncionaisExigePublicacoes = new HashSet<EventoServidorDadoFuncionalExigePublicacao>(); |
||
| 61 | |||
| 62 | private EventoServidorDadoFuncionalExigeProcesso eventoServidorDadoFuncionalExigeProcesso; |
||
| 63 | private EventoServidorDadoFuncionalExigeVigencia eventoServidorDadoFuncionalExigeVigencia; |
||
| 64 | |||
| 65 | private EventoServidorDadoFuncionalTransferenciaReconducao eventoServidorDadoFuncionalTransferenciaReconducao; |
||
| 66 | private EventoServidorDadoFuncionalRemocao eventoServidorDadoFuncionalRemocao; |
||
| 67 | private EventoServidorDadoFuncionalRedistribuicaoCessao eventoServidorDadoFuncionalRedistribuicaoCessao; |
||
| 68 | private EventoServidorDadoFuncionalAcesso eventoServidorDadoFuncionalAcesso; |
||
| 69 | private EventoServidorDadoFuncionalProgressaoFuncionalHorizontal EventoServidorDadoFuncionalProgressaoFuncionalHorizontal; |
||
| 70 | private EventoServidorDadoFuncionalProgressaoFuncionalVertical eventoServidorDadoFuncionalProgressaoFuncionalVertical; |
||
| 71 | |||
| 72 | @Id |
||
| 73 | @Column(name="seq_evento_servdadofunc", nullable=false) |
||
| 74 | @GeneratedValue(generator = "EVENTO_SERVIDOR_DADO_FUNCIONAL_GENERATOR", strategy = GenerationType.SEQUENCE) |
||
| 75 | @SequenceGenerator(name = "EVENTO_SERVIDOR_DADO_FUNCIONAL_GENERATOR", sequenceName = "sc_srv.sq_eveserdadfun", initialValue = 1, allocationSize = 1) |
||
| 76 | public Long getSequencial() { |
||
| 77 | return sequencial; |
||
| 78 | } |
||
| 79 | |||
| 80 | public void setSequencial(Long sequencial) { |
||
| 81 | this.sequencial = sequencial; |
||
| 82 | } |
||
| 83 | |||
| 84 | @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) |
||
| 85 | @ManyToOne |
||
| 86 | @JoinColumn(name="cod_evento", referencedColumnName="cod_evento", nullable=false) |
||
| 87 | @NotNull(message="Obrigatório informar evento.", groups={Cadastrar.class}) |
||
| 88 | public Evento getEvento() { |
||
| 89 | return evento; |
||
| 90 | } |
||
| 91 | |||
| 92 | public void setEvento(Evento evento) { |
||
| 93 | this.evento = evento; |
||
| 94 | } |
||
| 95 | |||
| 96 | @Column(name="tip_situacao_evento", length=1, nullable=false) |
||
| 97 | public String getTipoSituacaoEvento() { |
||
| 98 | return tipoSituacaoEvento; |
||
| 99 | } |
||
| 100 | |||
| 101 | public void setTipoSituacaoEvento(String tipoSituacaoEvento) { |
||
| 102 | this.tipoSituacaoEvento = tipoSituacaoEvento; |
||
| 103 | } |
||
| 104 | |||
| 105 | @Transient |
||
| 106 | public TipoSituacaoEvento getEnumTipoSituacao() { |
||
| 107 | return TipoSituacaoEvento.parse(tipoSituacaoEvento); |
||
| 108 | } |
||
| 109 | |||
| 110 | @Transient |
||
| 111 | public String getTipoSituacaoEventoDescricao() { |
||
| 112 | return TipoSituacaoEvento.parse(tipoSituacaoEvento).getDescricao(); |
||
| 113 | } |
||
| 114 | |||
| 115 | public void setTipoSituacaoEvento(TipoSituacaoEvento tipoSituacaoEvento) { |
||
| 116 | this.tipoSituacaoEvento = estaNulo(tipoSituacaoEvento) ? null : tipoSituacaoEvento.getValue(); |
||
| 117 | } |
||
| 118 | |||
| 119 | @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) |
||
| 120 | @ManyToOne(cascade=CascadeType.MERGE) |
||
| 121 | @JoinColumn(name="seq_servidor_dadofuncional", referencedColumnName="seq_servidor_dadofuncional", nullable=false) |
||
| 122 | public ServidorDadoFuncional getServidorDadoFuncional() { |
||
| 123 | return servidorDadoFuncional; |
||
| 124 | } |
||
| 125 | |||
| 126 | public void setServidorDadoFuncional(ServidorDadoFuncional servidorDadoFuncional) { |
||
| 127 | this.servidorDadoFuncional = servidorDadoFuncional; |
||
| 128 | } |
||
| 129 | |||
| 130 | @Temporal(TemporalType.DATE) |
||
| 131 | @Column(name="dat_evento", nullable=false) |
||
| 132 | @NotNull(message="Obrigatório informar data do evento.", groups={Cadastrar.class, Alterar.class}) |
||
| 133 | public Date getDataEvento() { |
||
| 134 | return dataEvento; |
||
| 135 | } |
||
| 136 | |||
| 137 | public void setDataEvento(Date dataEvento) { |
||
| 138 | this.dataEvento = dataEvento; |
||
| 139 | } |
||
| 140 | |||
| 141 | @Column(name="dsc_observacao") |
||
| 142 | public String getObservacao() { |
||
| 143 | return observacao; |
||
| 144 | } |
||
| 145 | |||
| 146 | public void setObservacao(String observacao) { |
||
| 147 | this.observacao = observacao; |
||
| 148 | } |
||
| 149 | |||
| 150 | @Column(name="ind_evento_retroativo", nullable=false) |
||
| 151 | @NotNull(message="Obrigatório informar indicador retroativo.", groups={Cadastrar.class, Alterar.class}) |
||
| 152 | public Boolean getIndicadorEventoRetroativo() { |
||
| 153 | return indicadorEventoRetroativo; |
||
| 154 | } |
||
| 155 | |||
| 156 | public void setIndicadorEventoRetroativo(Boolean indicadorEventoRetroativo) { |
||
| 157 | this.indicadorEventoRetroativo = indicadorEventoRetroativo; |
||
| 158 | } |
||
| 159 | |||
| 160 | @Valid |
||
| 161 | @NotAudited |
||
| 162 | @OneToMany(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 163 | public Set<EventoServidorDadoFuncionalDocumento> getEventoServidorDadoFuncionalDocumentos() { |
||
| 164 | return eventoServidorDadoFuncionalDocumentos; |
||
| 165 | } |
||
| 166 | |||
| 167 | public void setEventoServidorDadoFuncionalDocumentos(Set<EventoServidorDadoFuncionalDocumento> eventoServidorDadoFuncionalDocumentos) { |
||
| 168 | this.eventoServidorDadoFuncionalDocumentos = eventoServidorDadoFuncionalDocumentos; |
||
| 169 | } |
||
| 170 | |||
| 171 | @OneToMany(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 172 | public Set<EventoServidorDadoFuncionalExigePublicacao> getEventoServidorDadoFuncionaisExigePublicacoes() { |
||
| 173 | return eventoServidorDadoFuncionaisExigePublicacoes; |
||
| 174 | } |
||
| 175 | |||
| 176 | public void setEventoServidorDadoFuncionaisExigePublicacoes(Set<EventoServidorDadoFuncionalExigePublicacao> eventoServidorDadoFuncionaisExigePublicacoes) { |
||
| 177 | this.eventoServidorDadoFuncionaisExigePublicacoes = eventoServidorDadoFuncionaisExigePublicacoes; |
||
| 178 | } |
||
| 179 | |||
| 180 | @Transient |
||
| 181 | public EventoServidorDadoFuncionalExigePublicacao getEventoServidorDadoFuncionalExigePortaria() { |
||
| 182 | for(EventoServidorDadoFuncionalExigePublicacao eventoServidorDadoFuncionalExigePublicacao : eventoServidorDadoFuncionaisExigePublicacoes) { |
||
| 183 | if(TipoPublicacao.PORTARIA.getValue().equals(eventoServidorDadoFuncionalExigePublicacao.getTipoPublicacao())) { |
||
| 184 | return eventoServidorDadoFuncionalExigePublicacao; |
||
| 185 | } |
||
| 186 | } |
||
| 187 | return null; |
||
| 188 | } |
||
| 189 | |||
| 190 | @Transient |
||
| 191 | public EventoServidorDadoFuncionalExigePublicacao getEventoServidorDadoFuncionalExigeDecreto() { |
||
| 192 | for(EventoServidorDadoFuncionalExigePublicacao eventoServidorDadoFuncionalExigePublicacao : eventoServidorDadoFuncionaisExigePublicacoes) { |
||
| 193 | if(TipoPublicacao.DECRETO.getValue().equals(eventoServidorDadoFuncionalExigePublicacao.getTipoPublicacao())) { |
||
| 194 | return eventoServidorDadoFuncionalExigePublicacao; |
||
| 195 | } |
||
| 196 | } |
||
| 197 | return null; |
||
| 198 | } |
||
| 199 | |||
| 200 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 201 | public EventoServidorDadoFuncionalExigeProcesso getEventoServidorDadoFuncionalExigeProcesso() { |
||
| 202 | return eventoServidorDadoFuncionalExigeProcesso; |
||
| 203 | } |
||
| 204 | |||
| 205 | public void setEventoServidorDadoFuncionalExigeProcesso(EventoServidorDadoFuncionalExigeProcesso eventoServidorDadoFuncionalExigeProcesso) { |
||
| 206 | this.eventoServidorDadoFuncionalExigeProcesso = eventoServidorDadoFuncionalExigeProcesso; |
||
| 207 | } |
||
| 208 | |||
| 209 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 210 | public EventoServidorDadoFuncionalExigeVigencia getEventoServidorDadoFuncionalExigeVigencia() { |
||
| 211 | return eventoServidorDadoFuncionalExigeVigencia; |
||
| 212 | } |
||
| 213 | |||
| 214 | public void setEventoServidorDadoFuncionalExigeVigencia(EventoServidorDadoFuncionalExigeVigencia eventoServidorDadoFuncionalExigeVigencia) { |
||
| 215 | this.eventoServidorDadoFuncionalExigeVigencia = eventoServidorDadoFuncionalExigeVigencia; |
||
| 216 | } |
||
| 217 | |||
| 218 | @Valid |
||
| 219 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 220 | public EventoServidorDadoFuncionalTransferenciaReconducao getEventoServidorDadoFuncionalTransferenciaReconducao() { |
||
| 221 | return eventoServidorDadoFuncionalTransferenciaReconducao; |
||
| 222 | } |
||
| 223 | |||
| 224 | public void setEventoServidorDadoFuncionalTransferenciaReconducao(EventoServidorDadoFuncionalTransferenciaReconducao eventoServidorDadoFuncionalTransferenciaReconducao) { |
||
| 225 | this.eventoServidorDadoFuncionalTransferenciaReconducao = eventoServidorDadoFuncionalTransferenciaReconducao; |
||
| 226 | } |
||
| 227 | |||
| 228 | @Valid |
||
| 229 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 230 | public EventoServidorDadoFuncionalRemocao getEventoServidorDadoFuncionalRemocao() { |
||
| 231 | return eventoServidorDadoFuncionalRemocao; |
||
| 232 | } |
||
| 233 | |||
| 234 | public void setEventoServidorDadoFuncionalRemocao(EventoServidorDadoFuncionalRemocao eventoServidorDadoFuncionalRemocao) { |
||
| 235 | this.eventoServidorDadoFuncionalRemocao = eventoServidorDadoFuncionalRemocao; |
||
| 236 | } |
||
| 237 | |||
| 238 | @Valid |
||
| 239 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 240 | public EventoServidorDadoFuncionalRedistribuicaoCessao getEventoServidorDadoFuncionalRedistribuicaoCessao() { |
||
| 241 | return eventoServidorDadoFuncionalRedistribuicaoCessao; |
||
| 242 | } |
||
| 243 | |||
| 244 | public void setEventoServidorDadoFuncionalRedistribuicaoCessao(EventoServidorDadoFuncionalRedistribuicaoCessao eventoServidorDadoFuncionalRedistribuicaoCessao) { |
||
| 245 | this.eventoServidorDadoFuncionalRedistribuicaoCessao = eventoServidorDadoFuncionalRedistribuicaoCessao; |
||
| 246 | } |
||
| 247 | |||
| 248 | @Valid |
||
| 249 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 250 | public EventoServidorDadoFuncionalAcesso getEventoServidorDadoFuncionalAcesso() { |
||
| 251 | return eventoServidorDadoFuncionalAcesso; |
||
| 252 | } |
||
| 253 | |||
| 254 | public void setEventoServidorDadoFuncionalAcesso(EventoServidorDadoFuncionalAcesso eventoServidorDadoFuncionalAcesso) { |
||
| 255 | this.eventoServidorDadoFuncionalAcesso = eventoServidorDadoFuncionalAcesso; |
||
| 256 | } |
||
| 257 | |||
| 258 | @Valid |
||
| 259 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 260 | public EventoServidorDadoFuncionalProgressaoFuncionalHorizontal getEventoServidorDadoFuncionalProgressaoFuncionalHorizontal() { |
||
| 261 | return EventoServidorDadoFuncionalProgressaoFuncionalHorizontal; |
||
| 262 | } |
||
| 263 | |||
| 264 | public void setEventoServidorDadoFuncionalProgressaoFuncionalHorizontal(EventoServidorDadoFuncionalProgressaoFuncionalHorizontal eventoServidorDadoFuncionalProgressaoFuncionalHorizontal) { |
||
| 265 | EventoServidorDadoFuncionalProgressaoFuncionalHorizontal = eventoServidorDadoFuncionalProgressaoFuncionalHorizontal; |
||
| 266 | } |
||
| 267 | |||
| 268 | @Valid |
||
| 269 | @OneToOne(mappedBy="eventoServidorDadoFuncional", cascade=CascadeType.ALL, orphanRemoval=true) |
||
| 270 | public EventoServidorDadoFuncionalProgressaoFuncionalVertical getEventoServidorDadoFuncionalProgressaoFuncionalVertical() { |
||
| 271 | return eventoServidorDadoFuncionalProgressaoFuncionalVertical; |
||
| 272 | } |
||
| 273 | |||
| 274 | public void setEventoServidorDadoFuncionalProgressaoFuncionalVertical(EventoServidorDadoFuncionalProgressaoFuncionalVertical eventoServidorDadoFuncionalProgressaoFuncionalVertical) { |
||
| 275 | this.eventoServidorDadoFuncionalProgressaoFuncionalVertical = eventoServidorDadoFuncionalProgressaoFuncionalVertical; |
||
| 276 | } |
||
| 277 | |||
| 278 | @Transient |
||
| 279 | public String getIdenticadorProcesso() { |
||
| 280 | return naoEstaNulo(getEventoServidorDadoFuncionalExigeProcesso()) ? getEventoServidorDadoFuncionalExigeProcesso().getIdentificador() : ""; |
||
| 281 | } |
||
| 282 | |||
| 283 | @Transient |
||
| 284 | public String getNumeroPortaria() { |
||
| 285 | return naoEstaNulo(getEventoServidorDadoFuncionalExigePortaria()) ? getEventoServidorDadoFuncionalExigePortaria().getNumeroPublicacao() : ""; |
||
| 286 | } |
||
| 287 | |||
| 288 | @Transient |
||
| 289 | public String getNumeroDecreto() { |
||
| 290 | return naoEstaNulo(getEventoServidorDadoFuncionalExigeDecreto()) ? getEventoServidorDadoFuncionalExigeDecreto().getNumeroPublicacao() : ""; |
||
| 291 | } |
||
| 292 | |||
| 293 | @Transient |
||
| 294 | public String getDataInicialVigencia() { |
||
| 295 | return naoEstaNulo(getEventoServidorDadoFuncionalExigeVigencia()) ? converterDataParaString(getEventoServidorDadoFuncionalExigeVigencia().getDataInicial()) : ""; |
||
| 296 | } |
||
| 297 | |||
| 298 | @Transient |
||
| 299 | public String getDataFinalVigencia() { |
||
| 300 | return naoEstaNulo(getEventoServidorDadoFuncionalExigeVigencia()) ? converterDataParaString(getEventoServidorDadoFuncionalExigeVigencia().getDataFinal()) : ""; |
||
| 301 | } |
||
| 302 | |||
| 303 | @Transient |
||
| 304 | public String getCampoEspecifico() { |
||
| 305 | return naoEstaNulo(getTipoObjetoEventoServidor()) ? getTipoObjetoEventoServidor().getValue() : ""; |
||
| 306 | } |
||
| 307 | |||
| 308 | @Transient |
||
| 309 | public String getValorOrigemCampoEspecifico() { |
||
| 310 | TipoObjetoEventoServidor tipoEventoServidor = getTipoObjetoEventoServidor(); |
||
| 311 | if(estaNulo(tipoEventoServidor)) return ""; |
||
| 312 | |||
| 313 | switch(tipoEventoServidor) { |
||
| 314 | case TRANSFERENCIA_RECONDUCAO: return getEventoServidorDadoFuncionalTransferenciaReconducao().getCargoOrigem().getDescricao(); |
||
| 315 | case REMOCAO_OFICIOSA: |
||
| 316 | case REMOCAO_OFICIAL: return getEventoServidorDadoFuncionalRemocao().getUnidadeOrigem().getDescricao(); |
||
| 317 | case REDISTRIBUICAO_CESSAO: return getEventoServidorDadoFuncionalRedistribuicaoCessao().getOrgaoOrigem().getDescricao(); |
||
| 318 | case ACESSO: return getEventoServidorDadoFuncionalAcesso().getFuncaoOrigem().getDescricao(); |
||
| 319 | case PROGRESSAO_FUNCIONAL_HORIZONTAL: return getEventoServidorDadoFuncionalProgressaoFuncionalHorizontal().getTipoClasseCarreiraOrigemValor(); |
||
| 320 | case PROGRESSAO_FUNCIONAL_VERTICAL: return getEventoServidorDadoFuncionalProgressaoFuncionalVertical().getTipoNivelCarreiraOrigemValor(); |
||
| 321 | default: return null; |
||
| 322 | } |
||
| 323 | } |
||
| 324 | |||
| 325 | @Transient |
||
| 326 | public String getValorDestinoCampoEspecifico() { |
||
| 327 | TipoObjetoEventoServidor tipoEventoServidor = getTipoObjetoEventoServidor(); |
||
| 328 | if(estaNulo(tipoEventoServidor)) return ""; |
||
| 329 | |||
| 330 | switch(tipoEventoServidor) { |
||
| 331 | case TRANSFERENCIA_RECONDUCAO: return getEventoServidorDadoFuncionalTransferenciaReconducao().getCargoDestino().getDescricao(); |
||
| 332 | case REMOCAO_OFICIOSA: |
||
| 333 | case REMOCAO_OFICIAL: return getEventoServidorDadoFuncionalRemocao().getUnidadeDestino().getDescricao(); |
||
| 334 | case REDISTRIBUICAO_CESSAO: return getEventoServidorDadoFuncionalRedistribuicaoCessao().getOrgaoDestino().getDescricao(); |
||
| 335 | case ACESSO: return getEventoServidorDadoFuncionalAcesso().getFuncaoDestino().getDescricao(); |
||
| 336 | case PROGRESSAO_FUNCIONAL_HORIZONTAL: return getEventoServidorDadoFuncionalProgressaoFuncionalHorizontal().getTipoClasseCarreiraDestinoValor(); |
||
| 337 | case PROGRESSAO_FUNCIONAL_VERTICAL: return getEventoServidorDadoFuncionalProgressaoFuncionalVertical().getTipoNivelCarreiraDestinoValor(); |
||
| 338 | default: return null; |
||
| 339 | } |
||
| 340 | } |
||
| 341 | |||
| 342 | @Transient |
||
| 343 | private TipoObjetoEventoServidor getTipoObjetoEventoServidor() { |
||
| 344 | if(naoEstaNulo(getEventoServidorDadoFuncionalTransferenciaReconducao())) return TipoObjetoEventoServidor.TRANSFERENCIA_RECONDUCAO; |
||
| 345 | if(naoEstaNulo(getEventoServidorDadoFuncionalRemocao())) return getEventoServidorDadoFuncionalRemocao().getEnumTipoRemocao().equals(TipoRemocao.OFICIOSA) ? |
||
| 346 | TipoObjetoEventoServidor.REMOCAO_OFICIOSA : (getEventoServidorDadoFuncionalRemocao().getEnumTipoRemocao().equals(TipoRemocao.OFICIAL) ? |
||
| 347 | TipoObjetoEventoServidor.REMOCAO_OFICIAL : null); |
||
| 348 | if(naoEstaNulo(getEventoServidorDadoFuncionalRedistribuicaoCessao())) return TipoObjetoEventoServidor.REDISTRIBUICAO_CESSAO; |
||
| 349 | if(naoEstaNulo(getEventoServidorDadoFuncionalAcesso())) return TipoObjetoEventoServidor.ACESSO; |
||
| 350 | if(naoEstaNulo(getEventoServidorDadoFuncionalProgressaoFuncionalHorizontal())) return TipoObjetoEventoServidor.PROGRESSAO_FUNCIONAL_HORIZONTAL; |
||
| 351 | if(naoEstaNulo(getEventoServidorDadoFuncionalProgressaoFuncionalVertical())) return TipoObjetoEventoServidor.PROGRESSAO_FUNCIONAL_VERTICAL; |
||
| 352 | return null; |
||
| 353 | } |
||
| 354 | |||
| 355 | @Override |
||
| 356 | public void setId(Object id) { |
||
| 357 | this.sequencial = (Long) id; |
||
| 358 | } |
||
| 359 | |||
| 360 | @Transient |
||
| 361 | @Override |
||
| 362 | public Object getId() { |
||
| 363 | return this.sequencial; |
||
| 364 | } |
||
| 365 | |||
| 366 | @Override |
||
| 367 | public int hashCode() { |
||
| 368 | final int prime = 31; |
||
| 369 | int result = 1; |
||
| 370 | result = prime * result |
||
| 371 | + ((sequencial == null) ? 0 : sequencial.hashCode()); |
||
| 372 | return result; |
||
| 373 | } |
||
| 374 | |||
| 375 | @Override |
||
| 376 | public boolean equals(Object obj) { |
||
| 377 | if (this == obj) |
||
| 378 | return true; |
||
| 379 | if (obj == null) |
||
| 380 | return false; |
||
| 381 | if (!(obj instanceof EventoServidorDadoFuncional)) |
||
| 382 | return false; |
||
| 383 | EventoServidorDadoFuncional other = (EventoServidorDadoFuncional) obj; |
||
| 384 | if (sequencial == null) { |
||
| 385 | if (other.sequencial != null) |
||
| 386 | return false; |
||
| 387 | } else if (!sequencial.equals(other.sequencial)) |
||
| 388 | return false; |
||
| 389 | return true; |
||
| 390 | } |
||
| 391 | |||
| 392 | } |