/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.qsoft.erp.model; import java.io.Serializable; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.CascadeType; 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.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; /** * * @author james */ @Entity @Table(name = "TARIFARIO") @XmlRootElement @NamedQueries({ @NamedQuery(name = "Tarifario.findAll", query = "SELECT t FROM Tarifario t")}) public class Tarifario implements Serializable { private static final long serialVersionUID = 8357233807215L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "TAR_CODIGO") private Integer tarCodigo; @Basic(optional = false) @NotNull @Size(max = 1024) @Column(name = "TAR_NOMBRE") private String tarNombre; @Size(max = 255) @Column(name = "TAR_DESAGREGACION") private String tarDesagregacion; @Size(max = 255) @Column(name = "TAR_FORMA_FARMA") private String tarFormaFarma; @Size(max = 255) @Column(name = "TAR_CONCENTRACION") private String tarConcentracion; @Size(max = 250) @Column(name = "TAR_PRESENTACION") private String tarPresentacion; @Size(max = 255) @Column(name = "TAR_DESCRIPCION") private String tarDescripcion; @Column(name = "TAR_VALOR") private Double tarValor; @Column(name = "TAR_FACTOR") private Double tarFactor; @Column(name = "TAR_AUXILIAR") private Double tarAuxiliar; @Column(name = "TAR_TOTAL") private Double tarTotal; @Column(name = "TAR_ESTADO") private Short tarEstado; @JoinColumn(name = "DET_TIPO", referencedColumnName = "DET_CODIGO") @ManyToOne private DetalleCatalogo detTipo; @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarCodigo") private Collection tarifaLiquidacionCollection; public Tarifario() { } public Tarifario(Integer tarCodigo) { this.tarCodigo = tarCodigo; } public Tarifario(Integer tarCodigo, String tarNombre) { this.tarCodigo = tarCodigo; this.tarNombre = tarNombre; } public Integer getTarCodigo() { return tarCodigo; } public void setTarCodigo(Integer tarCodigo) { this.tarCodigo = tarCodigo; } public String getTarDescripcion() { return tarDescripcion; } public void setTarDescripcion(String tarDescripcion) { this.tarDescripcion = tarDescripcion; } public String getTarDesagregacion() { return tarDesagregacion; } public void setTarDesagregacion(String tarDesagregacion) { this.tarDesagregacion = tarDesagregacion; } public String getTarFormaFarma() { return tarFormaFarma; } public void setTarFormaFarma(String tarFormaFarma) { this.tarFormaFarma = tarFormaFarma; } public String getTarConcentracion() { return tarConcentracion; } public void setTarConcentracion(String tarConcentracion) { this.tarConcentracion = tarConcentracion; } public String getTarPresentacion() { return tarPresentacion; } public void setTarPresentacion(String tarPresentacion) { this.tarPresentacion = tarPresentacion; } public String getTarNombre() { return tarNombre; } public void setTarNombre(String tarNombre) { this.tarNombre = tarNombre; } public Double getTarValor() { return tarValor; } public void setTarValor(Double tarValor) { this.tarValor = tarValor; } public Double getTarFactor() { return tarFactor; } public void setTarFactor(Double tarFactor) { this.tarFactor = tarFactor; } public Double getTarAuxiliar() { return tarAuxiliar; } public void setTarAuxiliar(Double tarAuxiliar) { this.tarAuxiliar = tarAuxiliar; } public Double getTarTotal() { return tarTotal; } public void setTarTotal(Double tarTotal) { this.tarTotal = tarTotal; } public Short getTarEstado() { return tarEstado; } public void setTarEstado(Short tarEstado) { this.tarEstado = tarEstado; } public DetalleCatalogo getDetTipo() { return detTipo; } public void setDetTipo(DetalleCatalogo detTipo) { this.detTipo = detTipo; } @XmlTransient public Collection getTarifaLiquidacionCollection() { return tarifaLiquidacionCollection; } public void setTarifaLiquidacionCollection(Collection tarifaLiquidacionCollection) { this.tarifaLiquidacionCollection = tarifaLiquidacionCollection; } @Override public int hashCode() { int hash = 0; hash += (tarCodigo != null ? tarCodigo.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 Tarifario)) { return false; } Tarifario other = (Tarifario) object; if ((this.tarCodigo == null && other.tarCodigo != null) || (this.tarCodigo != null && !this.tarCodigo.equals(other.tarCodigo))) { return false; } return true; } @Override public String toString() { return "com.qsoft.wmp.model.Tarifario[ tarCodigo=" + tarCodigo + " ]"; } }