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.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@SequenceGenerator(name = "ORGAO_TRAMO_SEQ", sequenceName = "ORGAO_TRAMO_SEQ", allocationSize = 1)
@Table(name = "ORGAO_TRAMO")
public class OrgaoTramo implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "ORGAO_TRAMO_SEQ")
	@Basic(optional = false)
	@Column(name = "ORGAOTRAMO_ID")
	private Integer orgaoTramoId;
	@OneToOne
	@JoinColumn(name = "TRAMO_ID")
	private Tramo tramo;
	@OneToOne
	@JoinColumn(name = "COEFICIENTETARIFA1_ID")
	private CoeficienteTarifa coeficienteTarifa1;
	@Column(name = "KMCOEFICIENTE1")
	private BigDecimal kmCoeficiente1;
	@OneToOne
	@JoinColumn(name = "COEFICIENTETARIFA2_ID")
	private CoeficienteTarifa coeficienteTarifa2;
	@Column(name = "KMCOEFICIENTE2")
	private BigDecimal kmCoeficiente2;
	@OneToOne
	@JoinColumn(name = "COEFICIENTETARIFA3_ID")
	private CoeficienteTarifa coeficienteTarifa3;
	@Column(name = "KMCOEFICIENTE3")
	private BigDecimal kmCoeficiente3;
	@OneToOne
	@JoinColumn(name = "ORGAOCONCEDENTE_ID")
	private OrgaoConcedente orgaoConcedente;
	@OneToOne
	@JoinColumn(name = "CLASESERVICIO_ID")
	private ClaseServicio claseServicio;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;

	public Integer getOrgaoTramoId() {
		return orgaoTramoId;
	}

	public void setOrgaoTramoId(Integer orgaoTramoId) {
		this.orgaoTramoId = orgaoTramoId;
	}

	public Tramo getTramo() {
		return tramo;
	}

	public void setTramo(Tramo tramo) {
		this.tramo = tramo;
	}

	public CoeficienteTarifa getCoeficienteTarifa1() {
		return coeficienteTarifa1;
	}

	public void setCoeficienteTarifa1(CoeficienteTarifa coeficienteTarifa1) {
		this.coeficienteTarifa1 = coeficienteTarifa1;
	}

	public BigDecimal getKmCoeficiente1() {
		return kmCoeficiente1;
	}

	public void setKmCoeficiente1(BigDecimal kmCoeficiente1) {
		this.kmCoeficiente1 = kmCoeficiente1;
	}

	public CoeficienteTarifa getCoeficienteTarifa2() {
		return coeficienteTarifa2;
	}

	public void setCoeficienteTarifa2(CoeficienteTarifa coeficienteTarifa2) {
		this.coeficienteTarifa2 = coeficienteTarifa2;
	}

	public BigDecimal getKmCoeficiente2() {
		return kmCoeficiente2;
	}

	public void setKmCoeficiente2(BigDecimal kmCoeficiente2) {
		this.kmCoeficiente2 = kmCoeficiente2;
	}

	public CoeficienteTarifa getCoeficienteTarifa3() {
		return coeficienteTarifa3;
	}

	public void setCoeficienteTarifa3(CoeficienteTarifa coeficienteTarifa3) {
		this.coeficienteTarifa3 = coeficienteTarifa3;
	}

	public BigDecimal getKmCoeficiente3() {
		return kmCoeficiente3;
	}

	public void setKmCoeficiente3(BigDecimal kmCoeficiente3) {
		this.kmCoeficiente3 = kmCoeficiente3;
	}

	public OrgaoConcedente getOrgaoConcedente() {
		return orgaoConcedente;
	}

	public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
		this.orgaoConcedente = orgaoConcedente;
	}

	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;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((orgaoTramoId == null) ? 0 : orgaoTramoId.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;
		OrgaoTramo other = (OrgaoTramo) obj;
		if (orgaoTramoId == null) {
			if (other.orgaoTramoId != null)
				return false;
		} else if (!orgaoTramoId.equals(other.orgaoTramoId))
			return false;
		return true;
	}

	public ClaseServicio getClaseServicio() {
		return claseServicio;
	}

	public void setClaseServicio(ClaseServicio claseServicio) {
		this.claseServicio = claseServicio;
	}
}
