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_CREDIBANCO_CONFIG_SEQ", sequenceName = "EMPRESA_CREDIBANCO_CONFIG_SEQ", allocationSize = 1)
@Table(name = "EMPRESA_CREDIBANCO_CONFIG")
public class EmpresaCrediBancoConfig implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_CREDIBANCO_CONFIG_SEQ")
	@Column(name = "EMPRESACREDIBANCOCONFIG_ID")
	private Integer empresaCrediBancoConfigId;
	@OneToOne
	@JoinColumn(name = "EMPRESA_ID")
	private Empresa empresa;

	@Column(name = "CHAVE")
	private String chave;

	@Column(name = "VALOR")
	private String valor;

	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;

	public EmpresaCrediBancoConfig() {

	}

	public Integer getEmpresaCrediBancoConfigId() {
		return empresaCrediBancoConfigId;
	}

	public void setEmpresaCrediBancoConfigId(Integer empresaCrediBancoConfigId) {
		this.empresaCrediBancoConfigId = empresaCrediBancoConfigId;
	}

	public Empresa getEmpresa() {
		return empresa;
	}

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

	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;
	}

	public String getChave() {
		return chave;
	}

	public void setChave(String chave) {
		this.chave = chave;
	}

	public String getValor() {
		return valor;
	}

	public void setValor(String valor) {
		this.valor = valor;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((empresaCrediBancoConfigId == null) ? 0 : empresaCrediBancoConfigId.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;
		EmpresaCrediBancoConfig other = (EmpresaCrediBancoConfig) obj;
		if (empresaCrediBancoConfigId == null) {
			if (other.empresaCrediBancoConfigId != null)
				return false;
		} else if (!empresaCrediBancoConfigId.equals(other.empresaCrediBancoConfigId))
			return false;
		return true;
	}

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

}
