/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author rodrigo
 */
@Entity
@Table(name = "TARIFA_TIPOPTOVTA")
@SequenceGenerator(name = "TARIFA_TIPOPTOVTA_SEQ", sequenceName = "TARIFA_TIPOPTOVTA_SEQ", allocationSize = 1)
public class TarifaTipoptovta implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "TARIFA_TIPOPTOVTA_SEQ")
    @Column(name = "TARIFATIPOPTOVTA_ID")
    private Integer tarifatipoptovtaId;
    @Column(name = "PRECIO")
    private BigDecimal precio;
    @Column(name = "PRECIOREDABIERTO")
    private BigDecimal precioredabierto;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @OneToOne
    @JoinColumn(name = "TIPOPTOVTA_ID")
    private TipoPuntoVenta tipoPuntoVenta;
    @JoinColumn(name = "TARIFA_ID", referencedColumnName = "TARIFA_ID")
    @ManyToOne(fetch=FetchType.LAZY)
    private Tarifa tarifa;

    public TarifaTipoptovta() {
    }

    public TarifaTipoptovta(Integer tarifatipoptovtaId) {
        this.tarifatipoptovtaId = tarifatipoptovtaId;
    }

    public Integer getTarifatipoptovtaId() {
        return tarifatipoptovtaId;
    }

    public void setTarifatipoptovtaId(Integer tarifatipoptovtaId) {
        this.tarifatipoptovtaId = tarifatipoptovtaId;
    }

    public BigDecimal getPrecio() {
        return precio;
    }

    public void setPrecio(BigDecimal precio) {
        this.precio = precio;
    }

    public BigDecimal getPrecioredabierto() {
        return precioredabierto;
    }

    public void setPrecioredabierto(BigDecimal precioredabierto) {
        this.precioredabierto = precioredabierto;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    public Date getFecmodif() {
        return fecmodif;
    }

    public void setFecmodif(Date fecmodif) {
        this.fecmodif = fecmodif;
    }

    public Integer getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Integer usuarioId) {
        this.usuarioId = usuarioId;
    }

    public TipoPuntoVenta getTipoPuntoVenta() {
        return tipoPuntoVenta;
    }

    public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) {
        this.tipoPuntoVenta = tipoPuntoVenta;
    }
    
    

    public Tarifa getTarifa() {
		return tarifa;
	}

	public void setTarifa(Tarifa tarifa) {
		this.tarifa = tarifa;
	}

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

    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta[tarifatipoptovtaId=" + tarifatipoptovtaId + "]";
    }
}
