package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

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;

/**
 * 
 * @author Valdir.Cordeiro
 */
@Entity
@SequenceGenerator(name = "PRICING_CONEXAO_SEQ", sequenceName = "PRICING_CONEXAO_SEQ", allocationSize = 1)
@Table(name = "PRICING_CONEXAO")
public class PricingConexao implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_CONEXAO_SEQ")
	@Column(name = "PRICINGCONEXAO_ID")
	private Long pricingConexaoId;
	
	@Basic(optional = false)
	@Column(name = "ACTIVO")
	private Integer activo;
	
	@Basic(optional = false)
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	
	@Basic(optional = false)
	@Column(name = "USUARIO_ID")
	private int usuarioId;
	
	@JoinColumn(name = "PRICING_ID", referencedColumnName = "PRICING_ID")
	@ManyToOne
	private Pricing pricing;
	
	@JoinColumn(name = "CONEXIONCTRL_ID", referencedColumnName = "CONEXIONCTRL_ID")
	@ManyToOne
	private ConexionCtrl conexionCtrl;

	public PricingConexao() {
	}

	public Long getPricingConexaoId() {
		return pricingConexaoId;
	}

	public void setPricingConexaoId(Long pricingConexaoId) {
		this.pricingConexaoId = pricingConexaoId;
	}

	public Integer getActivo() {
		return activo;
	}

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

	public Date getFecmodif() {
		return fecmodif;
	}

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

	public int getUsuarioId() {
		return usuarioId;
	}

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

	public Pricing getPricing() {
		return pricing;
	}

	public void setPricing(Pricing pricing) {
		this.pricing = pricing;
	}

	public ConexionCtrl getConexionCtrl() {
		return conexionCtrl;
	}

	public void setConexionCtrl(ConexionCtrl conexionCtrl) {
		this.conexionCtrl = conexionCtrl;
	}

	@Override
	public int hashCode() {
		return Objects.hash(conexionCtrl, pricing);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PricingConexao other = (PricingConexao) obj;
		return Objects.equals(conexionCtrl, other.conexionCtrl) && Objects.equals(pricing, other.pricing);
	}
	
}
