/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
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;

/**
 * 
 * @author RJ
 */
@Entity
@SequenceGenerator(name = "SEGVKM_SEQ", sequenceName = "SEGVKM_SEQ", allocationSize = 1)
@Table(name = "SEGVKM")
public class SegVKM implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEGVKM_SEQ")
	@Column(name = "SEGVKM_ID")
	private Integer segVKMId;
	@Column(name = "KM")
	private BigDecimal km;
	@Column(name = "VALOR")
	private BigDecimal valor;
	@Column(name = "SERIE")
	private String serie;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
	@ManyToOne
	private OrgaoConcedente orgaoConcedente;

	public SegVKM() {
	}

	public SegVKM(Integer segVKMId) {
		this.segVKMId = segVKMId;
	}

	public Integer getSegVKMId() {
		return segVKMId;
	}

	public void setSegVKMId(Integer segVKMId) {
		this.segVKMId = segVKMId;
	}

	public BigDecimal getKm() {
		return km;
	}

	public void setKm(BigDecimal km) {
		this.km = km;
	}

	public BigDecimal getValor() {
		return valor;
	}

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

	public String getSerie() {
		return serie;
	}

	public void setSerie(String serie) {
		this.serie = serie;
	}

	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 OrgaoConcedente getOrgaoConcedente() {
		return orgaoConcedente;
	}

	public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
		this.orgaoConcedente = orgaoConcedente;
	}

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

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

	@Override
	public String toString() {
		return "com.rjconsultores.ventaboletos.entidad.SegVKM[ segVKMId=" + segVKMId + " ]";
	}
}
