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;

@Entity
@SequenceGenerator(name = "GP_PRICING_TIPOSERVICIO_SEQ", sequenceName = "GP_PRICING_TIPOSERVICIO_SEQ", allocationSize = 1)
@Table(name = "GP_PRICING_TIPOSERVICIO")
public class GP_PricingTipoServicio implements Serializable, Cloneable {

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "GP_PRICING_TIPOSERVICIO_SEQ")
	@Column(name = "PRICINGTIPOSERVICIO_ID")
	private Integer pricingtiposervicioId;
	
	@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 GP_Pricing pricing;
	
	@JoinColumn(name = "TIPOSERVICIO_ID", referencedColumnName = "TIPOSERVICIO_ID")
	@ManyToOne
	private TipoServicio tipoServicio;

	public GP_PricingTipoServicio() {
	}

	public GP_PricingTipoServicio(Integer pricingtiposervicioId) {
		this.pricingtiposervicioId = pricingtiposervicioId;
	}

	public Integer getPricingtiposervicioId() {
		return pricingtiposervicioId;
	}

	public void setPricingtiposervicioId(Integer pricingtiposervicioId) {
		this.pricingtiposervicioId = pricingtiposervicioId;
	}

	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 GP_Pricing getPricing() {
		return pricing;
	}

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

	public TipoServicio getTipoServicio() {
		return tipoServicio;
	}

	public void setTipoServicio(TipoServicio tipoServicio) {
		this.tipoServicio = tipoServicio;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (pricingtiposervicioId != null ? pricingtiposervicioId.hashCode() : 0);
		return hash;
	}

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

	@Override
	public String toString() {
		return " [ TIPO_SERVICO =" + tipoServicio.toString() + "]";
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
}
