package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;

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

@Entity
@SequenceGenerator(name = "PARADA_CODORGAOCONCEDENTE_SEQ", sequenceName = "PARADA_CODORGAOCONCEDENTE_SEQ", allocationSize = 1)
@Table(name = "PARADA_COD_ORGAOCONCEDENTE")
public class ParadaCodOrgaoConcedente implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "PARADA_CODORGAOCONCEDENTE_SEQ")
	@Column(name = "PARADACODORGAOCONCEDENTE_ID")
	private Integer paradaCodOrgaoConcedenteId;
	@OneToOne
	@JoinColumn(name = "PARADA_ID")
	private Parada parada;
	@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
	@ManyToOne
	private OrgaoConcedente orgaoConcedente;
	@Column(name = "CODIGO")
	private String codigo;
	public Integer getParadaCodOrgaoConcedenteId() {
		return paradaCodOrgaoConcedenteId;
	}
	public void setParadaCodOrgaoConcedenteId(Integer paradaCodOrgaoConcedenteId) {
		this.paradaCodOrgaoConcedenteId = paradaCodOrgaoConcedenteId;
	}
	public Parada getParada() {
		return parada;
	}
	public void setParada(Parada parada) {
		this.parada = parada;
	}
	public OrgaoConcedente getOrgaoConcedente() {
		return orgaoConcedente;
	}
	public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
		this.orgaoConcedente = orgaoConcedente;
	}
	public String getCodigo() {
		return codigo;
	}
	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}
	
	@Override
	public int hashCode() {
		int hash = 0;
		hash += (getParadaCodOrgaoConcedenteId() != null ? getParadaCodOrgaoConcedenteId().hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		if (!(object instanceof ParadaCodOrgaoConcedente)) {
			return false;
		}
		ParadaCodOrgaoConcedente other = (ParadaCodOrgaoConcedente) object;
		if ((this.getParadaCodOrgaoConcedenteId() == null && other.getParadaCodOrgaoConcedenteId() != null) || (this.getParadaCodOrgaoConcedenteId() != null && !this.getParadaCodOrgaoConcedenteId().equals(other.getParadaCodOrgaoConcedenteId()))) {
			return false;
		}
		return true;
	}
}
