/*
 * 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 java.util.List;
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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ryuuji
 */
@Entity
@Table(name = "metodo")
@XmlRootElement
@NamedQueries({
  @NamedQuery(name = "Metodo.findAll", query = "SELECT m FROM Metodo m")
  , @NamedQuery(name = "Metodo.findById", query = "SELECT m FROM Metodo m WHERE m.id = :id")
  , @NamedQuery(name = "Metodo.findByNombre", query = "SELECT m FROM Metodo m WHERE m.nombre = :nombre")
  , @NamedQuery(name = "Metodo.findByInsertedAt", query = "SELECT m FROM Metodo m WHERE m.insertedAt = :insertedAt")})
public class Metodo 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 = "nombre")
  private String nombre;
  @Basic(optional = false)
  @Column(name = "inserted_at")
  @Temporal(TemporalType.TIMESTAMP)
  private Date insertedAt;
  @OneToMany(mappedBy = "metodo")
  private List<DepositoCuentaCorriente> depositoCuentaCorrienteList;
  @OneToMany(mappedBy = "metodo")
  private List<DepositoTarjetaDebito> depositoTarjetaDebitoList;
  @OneToMany(mappedBy = "metodo")
  private List<GiroTarjetaDebito> giroTarjetaDebitoList;
  @OneToMany(mappedBy = "metodo")
  private List<GiroCuentaCorriente> giroCuentaCorrienteList;

  public Metodo() {
  }

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

  public Metodo(Integer id, String nombre, Date insertedAt) {
    this.id = id;
    this.nombre = nombre;
    this.insertedAt = insertedAt;
  }

  public Integer getId() {
    return id;
  }

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

  public String getNombre() {
    return nombre;
  }

  public void setNombre(String nombre) {
    this.nombre = nombre;
  }

  public Date getInsertedAt() {
    return insertedAt;
  }

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

  @XmlTransient
  public List<DepositoCuentaCorriente> getDepositoCuentaCorrienteList() {
    return depositoCuentaCorrienteList;
  }

  public void setDepositoCuentaCorrienteList(List<DepositoCuentaCorriente> depositoCuentaCorrienteList) {
    this.depositoCuentaCorrienteList = depositoCuentaCorrienteList;
  }

  @XmlTransient
  public List<DepositoTarjetaDebito> getDepositoTarjetaDebitoList() {
    return depositoTarjetaDebitoList;
  }

  public void setDepositoTarjetaDebitoList(List<DepositoTarjetaDebito> depositoTarjetaDebitoList) {
    this.depositoTarjetaDebitoList = depositoTarjetaDebitoList;
  }

  @XmlTransient
  public List<GiroTarjetaDebito> getGiroTarjetaDebitoList() {
    return giroTarjetaDebitoList;
  }

  public void setGiroTarjetaDebitoList(List<GiroTarjetaDebito> giroTarjetaDebitoList) {
    this.giroTarjetaDebitoList = giroTarjetaDebitoList;
  }

  @XmlTransient
  public List<GiroCuentaCorriente> getGiroCuentaCorrienteList() {
    return giroCuentaCorrienteList;
  }

  public void setGiroCuentaCorrienteList(List<GiroCuentaCorriente> giroCuentaCorrienteList) {
    this.giroCuentaCorrienteList = giroCuentaCorrienteList;
  }

  @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 Metodo)) {
      return false;
    }
    Metodo other = (Metodo) 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.Metodo[ id=" + id + " ]";
  }
  
}
