/*
 * 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.util.Date;
import java.util.List;
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.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.SequenceGenerator;

/**
 * 
 * @author Rafius
 */
@Entity
@SequenceGenerator(name = "MONEDA_SEQ", sequenceName = "MONEDA_SEQ", allocationSize = 1)
@Table(name = "MONEDA")
public class Moneda implements Serializable {

	public final static Integer MONEDA_REAL_ID = 1;
	@OneToMany(mappedBy = "moneda")
	private List<TarifaHist> tarifaHistList;
	private static final long serialVersionUID = 1L;
	@Id
	@Basic(optional = false)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "MONEDA_SEQ")
	@Column(name = "MONEDA_ID")
	private Integer monedaId;
	@Column(name = "DESCMONEDA")	
	private String descmoneda;
	@Column(name = "SIMBOLO")
	private String simbolo;
	@Column(name = "ACTIVO")
	private Boolean activo;
	@Column(name = "FECMODIF")
	@Temporal(TemporalType.TIMESTAMP)
	private Date fecmodif;
	@Column(name = "USUARIO_ID")
	private Integer usuarioId;
	@OneToMany(mappedBy = "moneda")
	private List<PuntoVenta> puntoVentaList;
	@Column(name = "EQUIVALENCIA_ID")
	private String equivalenciaId;
	@Column(name = "SIGLA")
	private String sigla;

	public Moneda() {
	}

	public Moneda(Integer monedaId) {
		this.monedaId = monedaId;
	}

	public Integer getMonedaId() {
		return monedaId;
	}

	public void setMonedaId(Integer monedaId) {
		this.monedaId = monedaId;
	}

	public String getDescmoneda() {
		return descmoneda;
	}

	public void setDescmoneda(String descmoneda) {
		this.descmoneda = descmoneda;
	}

	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 List<PuntoVenta> getPuntoVentaList() {
		return puntoVentaList;
	}

	public void setPuntoVentaList(List<PuntoVenta> puntoVentaList) {
		this.puntoVentaList = puntoVentaList;
	}

	public String getEquivalenciaId() {
		return equivalenciaId;
	}

	public void setEquivalenciaId(String equivalenciaId) {
		this.equivalenciaId = equivalenciaId;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (monedaId != null ? monedaId.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 Moneda)) {
			return false;
		}
		Moneda other = (Moneda) object;
		if ((this.monedaId == null && other.monedaId != null) || (this.monedaId != null && !this.monedaId.equals(other.monedaId))) {
			return false;
		}
		return true;
	}

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

	public List<TarifaHist> getTarifaHistList() {
		return tarifaHistList;
	}

	public void setTarifaHistList(List<TarifaHist> tarifaHistList) {
		this.tarifaHistList = tarifaHistList;
	}
	
	public String getSimbolo() {
		return simbolo;
	}

	public void setSimbolo(String simbolo) {
		this.simbolo = simbolo;
	}

	public String getSigla() {
		return sigla;
	}

	public void setSigla(String sigla) {
		this.sigla = sigla;
	}

	@Override
	public Object clone() throws CloneNotSupportedException {
		return this.clone();
	}
}
