package com.rjconsultores.ventaboletos.entidad;

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 = "SECRETARIA_EMPRESA_SEQ", sequenceName = "SECRETARIA_EMPRESA_SEQ", allocationSize = 1)
@Table(name = "SECRETARIA_EMPRESA")
public class SecretariaEmpresa {
	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SECRETARIA_EMPRESA_SEQ")
	@Column(name = "SECRETARIAEMPRESA_ID")
	private Integer secretariaempresaId;
	@ManyToOne
	@JoinColumn(name = "SECRETARIA_ID")
	private Secretaria secretaria;
	@ManyToOne
	@JoinColumn(name = "EMPRESA_ID")
	private Empresa empresa;
	
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	@Column(name = "ACTIVO")
	private Boolean activo;
		
	public SecretariaEmpresa(){
		this.activo = true;
	}
	
	public Integer getSecretariaempresaId() {
		return secretariaempresaId;
	}
	public void setSecretariaempresaId(Integer secretariaempresaId) {
		this.secretariaempresaId = secretariaempresaId;
	}
	public Secretaria getSecretaria() {
		return secretaria;
	}
	public void setSecretaria(Secretaria secretaria) {
		this.secretaria = secretaria;
	}
	public Empresa getEmpresa() {
		return empresa;
	}
	public void setEmpresa(Empresa empresa) {
		this.empresa = empresa;
	}
	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 Boolean getActivo() {
		return activo;
	}
	public void setActivo(Boolean activo) {
		this.activo = activo;
	}
	
	@Override
    public int hashCode() {
        int hash = 0;
        hash += (secretariaempresaId != null ? secretariaempresaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SecretariaEmpresa)) {
            return false;
        }
        SecretariaEmpresa other = (SecretariaEmpresa) object;
        if ((this.secretariaempresaId == null && other.secretariaempresaId != null) || (this.secretariaempresaId != null && !this.secretariaempresaId.equals(other.secretariaempresaId))) {
            return false;
        }
        return true;
    }
    
    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.SecretariaEmpresa[secretariaempresaId=" + secretariaempresaId + "]";
    }
}
