Blame |
Last modification |
View Log
| Download
| RSS feed
package br.gov.al.saude.srv.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import br.gov.al.saude.framework.core.generic.identidade.Identidade;
import br.gov.al.saude.framework.core.util.VerificadorUtil;
import br.gov.al.saude.srv.model.enums.TipoVinculo;
@
Entity
@Table
(name=
"srv_forma_ingresso", schema=
"sc_srv")
public class FormaIngresso
implements Serializable, Identidade
{
private static final long serialVersionUID = 1L
;
public static Integer FORMA_INGRESSO_CONCURSADO =
1;
public static Integer FORMA_INGRESSO_COMISSIONADO =
3;
public static Integer FORMA_INGRESSO_PROCESSO_SELETIVO =
8;
public static Integer FORMA_INGRESSO_PRESTADOR =
9;
public static Integer FORMA_INGRESSO_ESTAGIARIO =
4;
private Integer codigo
;
private String descricao
;
private String tipoVinculo
;
@Id
@Column
(name=
"cod_forma_ingresso", length=
3, nullable=
false)
public Integer getCodigo
() {
return codigo
;
}
public void setCodigo
(Integer codigo
) {
this.
codigo = codigo
;
}
@Column
(name=
"dsc_forma_ingresso", length=
50, nullable=
false)
public String getDescricao
() {
return descricao
;
}
public void setDescricao
(String descricao
) {
this.
descricao = descricao
;
}
@Column
(name=
"tip_vinculo_forma_ingresso", length=
1, nullable=
false)
public String getTipoVinculo
() {
return tipoVinculo
;
}
public void setTipoVinculo
(String tipoVinculo
) {
this.
tipoVinculo = tipoVinculo
;
}
@Transient
public String getDescricaoTipoVinculo
() {
return VerificadorUtil.
naoEstaNuloOuVazio(tipoVinculo
) ? TipoVinculo.
parse(tipoVinculo
).
getDescricao() :
"";
}
@Transient
@
Override
public Object getId
() {
return getCodigo
();
}
@
Override
public void setId
(Object id
) {
setCodigo
((Integer) id
);
}
@
Override
public int hashCode
() {
final int prime =
31;
int result =
1;
result = prime
* result +
((codigo ==
null) ? 0 : codigo.
hashCode());
return result
;
}
@
Override
public boolean equals
(Object obj
) {
if (this == obj
)
return true;
if (obj ==
null)
return false;
if (getClass
() != obj.
getClass())
return false;
FormaIngresso other =
(FormaIngresso
) obj
;
if (codigo ==
null) {
if (other.
codigo !=
null)
return false;
} else if (!codigo.
equals(other.
codigo))
return false;
return true;
}
}