@author Paulo
*/
@Entity
@Table(name = “TP_HISTORICO”)
public class TpHistorico implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = “TPH_ID”)
private Integer tphId;
@Basic(optional = false)
@Column(name = “TPH_DATAINICIO”)
@Temporal(TemporalType.TIMESTAMP)
private Date tphDatainicio;
@Basic(optional = false)
@Column(name = “TPH_DATATERMINO”)
@Temporal(TemporalType.TIMESTAMP)
private Date tphDatatermino;
@Basic(optional = true)
@Lob
@Column(name = “TPH_DESCRICAO”)
private String tphDescricao;
@JoinColumn(name = “FASE_ID”, referencedColumnName = “FASE_ID”)
@ManyToOne(optional = false)
private Fase tpHfaseId;
@JoinColumn(name = “TP_ID”, referencedColumnName = “TP_ID”)
@ManyToOne(optional = false)
private Tarefaprogramada tphTpId;
@JoinColumn(name = “USUARIO_ID”, referencedColumnName = “USUARIO_ID”)
@ManyToOne(optional = false)
private Usuario usuarioIdHistorico;
public TpHistorico() {
tphId = 0;
tphDatainicio = new Date();
tphDatatermino = new Date();
tphDescricao = “”;
tphTpId = new Tarefaprogramada();
tpHfaseId = new Fase();
usuarioIdHistorico = new Usuario();
tpHfaseId = new Fase();
}
public TpHistorico(Integer tphId) {
this.tphId = tphId;
}
public TpHistorico(Integer tphId, Date tphDatainicio, Date tphDatatermino, String tphDescricao, Fase tpHfaseId, Tarefaprogramada tphTpId, Usuario usuarioIdHistorico) {
this.tphId = tphId;
this.tphDatainicio = tphDatainicio;
this.tphDatatermino = tphDatatermino;
this.tphDescricao = tphDescricao;
this.tpHfaseId = tpHfaseId;
this.tphTpId = tphTpId;
this.usuarioIdHistorico = usuarioIdHistorico;
}
public Integer getTphId() {
return tphId;
}
public void setTphId(Integer tphId) {
this.tphId = tphId;
}
public Date getTphDatainicio() {
return tphDatainicio;
}
public void setTphDatainicio(Date tphDatainicio) {
this.tphDatainicio = tphDatainicio;
}
public Date getTphDatatermino() {
return tphDatatermino;
}
public void setTphDatatermino(Date tphDatatermino) {
this.tphDatatermino = tphDatatermino;
}
public String getTphDescricao() {
return tphDescricao;
}
public void setTphDescricao(String tphDescricao) {
this.tphDescricao = tphDescricao;
}
public Fase getFaseId() {
return tpHfaseId;
}
public void setFaseId(Fase faseId) {
this.tpHfaseId = faseId;
}
public Tarefaprogramada getTpId() {
return tphTpId;
}
public void setTpId(Tarefaprogramada tpId) {
this.tphTpId = tpId;
}
public Usuario getUsuarioIdHistorico() {
return usuarioIdHistorico;
}
public void setUsuarioIdHistorico(Usuario usuarioIdHistorico) {
this.usuarioIdHistorico = usuarioIdHistorico;
}
public Fase getTpHfaseId() {
return tpHfaseId;
}
public void setTpHfaseId(Fase tpHfaseId) {
this.tpHfaseId = tpHfaseId;
}
public Tarefaprogramada getTphTpId() {
return tphTpId;
}
public void setTphTpId(Tarefaprogramada tphTpId) {
this.tphTpId = tphTpId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (tphId != null ? tphId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won’t work in the case the id fields are not set
if (!(object instanceof TpHistorico)) {
return false;
}
TpHistorico other = (TpHistorico) object;
if ((this.tphId == null && other.tphId != null) || (this.tphId != null && !this.tphId.equals(other.tphId))) {
return false;
}
return true;
}
@Override
public String toString() {
return “modelo.entidade.TpHistorico[tphId=” + tphId + “]”;
}
}