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 = "EMPRESA_CONFIG_LAYOUT_SEQ", sequenceName = "EMPRESA_CONFIG_LAYOUT_SEQ", allocationSize = 1)
@Table(name = "EMPRESA_CONFIG_LAYOUT")
public class EmpresaConfigLayout implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_CONFIG_LAYOUT_SEQ")
	@Column(name = "EMPRESACONFIGLAYOUT_ID")
	private Integer empresaconfiglayoutId;

	@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
	@ManyToOne
	private Empresa empresa;

	@JoinColumn(name = "IMPRESIONLAYOUTCONFIG_ID", referencedColumnName = "IMPRESIONLAYOUTCONFIG_ID")
	@ManyToOne
	private ImpresionLayoutConfig impresionlayoutconfigId;

	@JoinColumn(name = "TIPOVENTA_ID", referencedColumnName = "TIPOVENTA_ID")
	@ManyToOne
	private TipoVenta tipoVenta;

	@Column(name = "INDEMAIL")
	private Boolean indEmail;

	@Column(name = "ACTIVO")
	private Boolean activo;

	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;

	@Column(name = "USUARIO_ID")
	private Integer usuarioId;

	public Integer getEmpresaconfiglayoutId() {
		return empresaconfiglayoutId;
	}

	public void setEmpresaconfiglayoutId(Integer empresaconfiglayoutId) {
		this.empresaconfiglayoutId = empresaconfiglayoutId;
	}

	public Empresa getEmpresa() {
		return empresa;
	}

	public void setEmpresa(Empresa empresa) {
		this.empresa = empresa;
	}

	public ImpresionLayoutConfig getImpresionlayoutconfigId() {
		return impresionlayoutconfigId;
	}

	public void setImpresionlayoutconfigId(ImpresionLayoutConfig impresionlayoutconfigId) {
		this.impresionlayoutconfigId = impresionlayoutconfigId;
	}

	public TipoVenta getTipoVenta() {
		return tipoVenta;
	}

	public void setTipoVenta(TipoVenta tipoVenta) {
		this.tipoVenta = tipoVenta;
	}

	public Boolean getIndEmail() {
		return indEmail;
	}

	public void setIndEmail(Boolean indEmail) {
		this.indEmail = indEmail;
	}

	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 String toString() {
		return "EmpresaConfigLayout [empresaconfiglayoutId=" + empresaconfiglayoutId + ", empresa=" + empresa
				+ ", impresionlayoutconfigId=" + impresionlayoutconfigId + ", tipoVenta=" + tipoVenta + ", indEmail="
				+ indEmail + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((activo == null) ? 0 : activo.hashCode());
		result = prime * result + ((empresa == null) ? 0 : empresa.hashCode());
		result = prime * result + ((empresaconfiglayoutId == null) ? 0 : empresaconfiglayoutId.hashCode());
		result = prime * result + ((impresionlayoutconfigId == null) ? 0 : impresionlayoutconfigId.hashCode());
		result = prime * result + ((indEmail == null) ? 0 : indEmail.hashCode());
		result = prime * result + ((tipoVenta == null) ? 0 : tipoVenta.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof EmpresaConfigLayout)) {
			return false;
		}
		EmpresaConfigLayout other = (EmpresaConfigLayout) obj;
		if (activo == null) {
			if (other.activo != null) {
				return false;
			}
		} else if (!activo.equals(other.activo)) {
			return false;
		}
		if (empresa == null) {
			if (other.empresa != null) {
				return false;
			}
		} else if (!empresa.equals(other.empresa)) {
			return false;
		}
		if (empresaconfiglayoutId == null) {
			if (other.empresaconfiglayoutId != null) {
				return false;
			}
		} else if (!empresaconfiglayoutId.equals(other.empresaconfiglayoutId)) {
			return false;
		}
		if (impresionlayoutconfigId == null) {
			if (other.impresionlayoutconfigId != null) {
				return false;
			}
		} else if (!impresionlayoutconfigId.equals(other.impresionlayoutconfigId)) {
			return false;
		}
		if (indEmail == null) {
			if (other.indEmail != null) {
				return false;
			}
		} else if (!indEmail.equals(other.indEmail)) {
			return false;
		}
		if (tipoVenta == null) {
			if (other.tipoVenta != null) {
				return false;
			}
		} else if (!tipoVenta.equals(other.tipoVenta)) {
			return false;
		}
		return true;
	}

}