/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ryuuji
 */
@Entity
@Table(name = "deposito_tarjeta_debito")
@XmlRootElement
@NamedQueries({
  @NamedQuery(name = "DepositoTarjetaDebito.findAll", query = "SELECT d FROM DepositoTarjetaDebito d")
  , @NamedQuery(name = "DepositoTarjetaDebito.findById", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.id = :id")
  , @NamedQuery(name = "DepositoTarjetaDebito.findByMonto", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.monto = :monto")
  , @NamedQuery(name = "DepositoTarjetaDebito.findByComentario", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.comentario = :comentario")
  , @NamedQuery(name = "DepositoTarjetaDebito.findByInsertedAt", query = "SELECT d FROM DepositoTarjetaDebito d WHERE d.insertedAt = :insertedAt")})
public class DepositoTarjetaDebito implements Serializable {

  private static final long serialVersionUID = 1L;
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Basic(optional = false)
  @Column(name = "id")
  private Integer id;
  @Basic(optional = false)
  @Column(name = "monto")
  private int monto;
  @Column(name = "comentario")
  private String comentario;
  @Basic(optional = false)
  @Column(name = "inserted_at")
  @Temporal(TemporalType.TIMESTAMP)
  private Date insertedAt;
  @JoinColumn(name = "metodo", referencedColumnName = "id")
  @ManyToOne
  private Metodo metodo;
  @JoinColumn(name = "tarjeta_debito", referencedColumnName = "id")
  @ManyToOne
  private TarjetaDebito tarjetaDebito;

  public DepositoTarjetaDebito() {
  }

  public DepositoTarjetaDebito(Integer id) {
    this.id = id;
  }

  public DepositoTarjetaDebito(Integer id, int monto, Date insertedAt) {
    this.id = id;
    this.monto = monto;
    this.insertedAt = insertedAt;
  }

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public int getMonto() {
    return monto;
  }

  public void setMonto(int monto) {
    this.monto = monto;
  }

  public String getComentario() {
    return comentario;
  }

  public void setComentario(String comentario) {
    this.comentario = comentario;
  }

  public Date getInsertedAt() {
    return insertedAt;
  }

  public void setInsertedAt(Date insertedAt) {
    this.insertedAt = insertedAt;
  }

  public Metodo getMetodo() {
    return metodo;
  }

  public void setMetodo(Metodo metodo) {
    this.metodo = metodo;
  }

  public TarjetaDebito getTarjetaDebito() {
    return tarjetaDebito;
  }

  public void setTarjetaDebito(TarjetaDebito tarjetaDebito) {
    this.tarjetaDebito = tarjetaDebito;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (id != null ? id.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 DepositoTarjetaDebito)) {
      return false;
    }
    DepositoTarjetaDebito other = (DepositoTarjetaDebito) object;
    if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
      return false;
    return true;
  }

  @Override
  public String toString() {
    return "entities.DepositoTarjetaDebito[ id=" + id + " ]";
  }
  
}
