package com.rjconsultores.ventaboletos.entidad;

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.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.apache.commons.lang.BooleanUtils;

@Entity
@SequenceGenerator(name = "RUTA_ICMS_EXCEPCION_SEQ", sequenceName = "RUTA_ICMS_EXCEPCION_SEQ", allocationSize = 1)
@Table(name = "RUTA_ICMS_EXCEPCION")
public class RutaIcmsExcepcion implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_ICMS_EXCEPCION_SEQ")
	@Column(name = "RUTAICMSEXCEPCION_ID")
	private Integer rutaIcmsExcepcionId;

	@Column(name = "INDTRIBTARIFA")
	private Boolean indTribTarifa;

	@Column(name = "INDTRIBTAXAEMBARQUE")
	private Boolean indTribTaxaEmbarque;

	@Column(name = "INDTRIBPEDAGIO")
	private Boolean indTribPedagio;

	@ManyToOne
	@JoinColumn(name = "RUTA_ID")
	private Ruta ruta;

	@ManyToOne
	@JoinColumn(name = "ORIGEN_ID")
	private Parada origen;

	@ManyToOne
	@JoinColumn(name = "DESTINO_ID")
	private Parada destino;

	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	
	@Column(name = "indCST41")
	private Boolean indCST41;
	
	public Integer getRutaIcmsExcepcionId() {
		return rutaIcmsExcepcionId;
	}

	public void setRutaIcmsExcepcionId(Integer rutaIcmsExcepcionId) {
		this.rutaIcmsExcepcionId = rutaIcmsExcepcionId;
	}

	public Boolean getIndTribTarifa() {
		return BooleanUtils.toBooleanObject(indTribTarifa);
	}

	public void setIndTribTarifa(Boolean indTribTarifa) {
		this.indTribTarifa = indTribTarifa;
	}

	public Boolean getIndTribTaxaEmbarque() {
		return BooleanUtils.toBooleanObject(indTribTaxaEmbarque);
	}

	public void setIndTribTaxaEmbarque(Boolean indTribTaxaEmbarque) {
		this.indTribTaxaEmbarque = indTribTaxaEmbarque;
	}

	public Boolean getIndTribPedagio() {
		return BooleanUtils.toBooleanObject(indTribPedagio);
	}

	public void setIndTribPedagio(Boolean indTribPedagio) {
		this.indTribPedagio = indTribPedagio;
	}

	public Ruta getRuta() {
		return ruta;
	}

	public void setRuta(Ruta ruta) {
		this.ruta = ruta;
	}

	public Parada getOrigen() {
		return origen;
	}

	public void setOrigen(Parada origen) {
		this.origen = origen;
	}

	public Parada getDestino() {
		return destino;
	}

	public void setDestino(Parada destino) {
		this.destino = destino;
	}

	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 Boolean getIndCST41() {
		return indCST41;
	}

	public void setIndCST41(Boolean indCST41) {
		this.indCST41 = indCST41;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getRutaIcmsExcepcionId() == null) ? 0 : getRutaIcmsExcepcionId().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof RutaIcmsExcepcion))
			return false;
		RutaIcmsExcepcion other = (RutaIcmsExcepcion) obj;
		if (getRutaIcmsExcepcionId() == null) {
			if (other.getRutaIcmsExcepcionId() != null)
				return false;
		} else if (!getRutaIcmsExcepcionId().equals(other.getRutaIcmsExcepcionId()))
			return false;
		return true;
	}

}
