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

@Entity
@SequenceGenerator(name = "EMPRESA_MERCADOPAGO_CONFIG_SEQ", sequenceName = "EMPRESA_MERCADOPAGO_CONFIG_SEQ", allocationSize = 1)
@Table(name = "EMPRESA_MERCADOPAGO_CONFIG")
public class EmpresaMercadoPagoConfig implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_MERCADOPAGO_CONFIG_SEQ")
	@Column(name = "EMPRESAMERCADOPAGOCONFIG_ID")
	private Integer empresaMercadoPagoConfigId;
	@OneToOne
	@JoinColumn(name = "EMPRESA_ID")
	private Empresa empresa;
	@Column(name = "USER_ID")
	private String userId;
	@Column(name = "STORE")
	private String store;
	@Column(name = "POS")
	private String pos;
	@Column(name = "TOKEN")
	private String token;
	@Column(name = "URL_API")
	private String urlApi;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;

	public EmpresaMercadoPagoConfig() {

	}

	public Integer getEmpresaMercadoPagoConfigId() {
		return empresaMercadoPagoConfigId;
	}

	public void setEmpresaMercadoPagoConfigId(Integer empresaMercadoPagoConfigId) {
		this.empresaMercadoPagoConfigId = empresaMercadoPagoConfigId;
	}

	public Empresa getEmpresa() {
		return empresa;
	}

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

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getStore() {
		return store;
	}

	public void setStore(String store) {
		this.store = store;
	}

	public String getPos() {
		return pos;
	}

	public void setPos(String pos) {
		this.pos = pos;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getUrlApi() {
		return urlApi;
	}

	public void setUrlApi(String urlApi) {
		this.urlApi = urlApi;
	}

	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 + ((empresaMercadoPagoConfigId == null) ? 0 : empresaMercadoPagoConfigId.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;
		EmpresaMercadoPagoConfig other = (EmpresaMercadoPagoConfig) obj;
		if (empresaMercadoPagoConfigId == null) {
			if (other.empresaMercadoPagoConfigId != null)
				return false;
		} else if (!empresaMercadoPagoConfigId.equals(other.empresaMercadoPagoConfigId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return String.valueOf(this.getEmpresaMercadoPagoConfigId());
	}

}
