package banco.modelo; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity public class Caixa implements Serializable{ private static final long serialVersionUID = -6931660530797198511L; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Column private BigDecimal valorAbertura; @Column private BigDecimal valorFechamento; @Temporal(TemporalType.TIMESTAMP) private Date dataAbertura; @Temporal(TemporalType.TIMESTAMP) private Date dataFechamento; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public BigDecimal getValorAbertura() { return valorAbertura; } public void setValorAbertura(BigDecimal valorAbertura) { this.valorAbertura = valorAbertura; } public BigDecimal getValorFechamento() { return valorFechamento; } public void setValorFechamento(BigDecimal valorFechamento) { this.valorFechamento = valorFechamento; } public Date getDataAbertura() { return dataAbertura; } public void setDataAbertura(Date dataAbertura) { this.dataAbertura = dataAbertura; } public Date getDataFechamento() { return dataFechamento; } public void setDataFechamento(Date dataFechamento) { this.dataFechamento = dataFechamento; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.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; Caixa other = (Caixa) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }