/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TestRest;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author aparnab
 */
@Entity
@Table(name = "NETMAG")
@NamedQueries({@NamedQuery(name = "Netmag.findAll", query = "SELECT n FROM Netmag n"), @NamedQuery(name = "Netmag.findByMagid", query = "SELECT n FROM Netmag n WHERE n.magid = :magid"), @NamedQuery(name = "Netmag.findByOrid", query = "SELECT n FROM Netmag n WHERE n.orid = :orid"), @NamedQuery(name = "Netmag.findByCommid", query = "SELECT n FROM Netmag n WHERE n.commid = :commid"), @NamedQuery(name = "Netmag.findByMagnitude", query = "SELECT n FROM Netmag n WHERE n.magnitude = :magnitude"), @NamedQuery(name = "Netmag.findByMagtype", query = "SELECT n FROM Netmag n WHERE n.magtype = :magtype"), @NamedQuery(name = "Netmag.findByAuth", query = "SELECT n FROM Netmag n WHERE n.auth = :auth"), @NamedQuery(name = "Netmag.findBySubsource", query = "SELECT n FROM Netmag n WHERE n.subsource = :subsource"), @NamedQuery(name = "Netmag.findByMagalgo", query = "SELECT n FROM Netmag n WHERE n.magalgo = :magalgo"), @NamedQuery(name = "Netmag.findByNsta", query = "SELECT n FROM Netmag n WHERE n.nsta = :nsta"), @NamedQuery(name = "Netmag.findByUncertainty", query = "SELECT n FROM Netmag n WHERE n.uncertainty = :uncertainty"), @NamedQuery(name = "Netmag.findByGap", query = "SELECT n FROM Netmag n WHERE n.gap = :gap"), @NamedQuery(name = "Netmag.findByDistance", query = "SELECT n FROM Netmag n WHERE n.distance = :distance"), @NamedQuery(name = "Netmag.findByQuality", query = "SELECT n FROM Netmag n WHERE n.quality = :quality"), @NamedQuery(name = "Netmag.findByRflag", query = "SELECT n FROM Netmag n WHERE n.rflag = :rflag"), @NamedQuery(name = "Netmag.findByLddate", query = "SELECT n FROM Netmag n WHERE n.lddate = :lddate")})
public class Netmag implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "MAGID")
    private Long magid;
    @Basic(optional = false)
    @Column(name = "ORID")
    private long orid;
    @Column(name = "COMMID")
    private Long commid;
    @Basic(optional = false)
    @Column(name = "MAGNITUDE")
    private BigDecimal magnitude;
    @Basic(optional = false)
    @Column(name = "MAGTYPE")
    private String magtype;
    @Basic(optional = false)
    @Column(name = "AUTH")
    private String auth;
    @Column(name = "SUBSOURCE")
    private String subsource;
    @Column(name = "MAGALGO")
    private String magalgo;
    @Column(name = "NSTA")
    private Integer nsta;
    @Column(name = "UNCERTAINTY")
    private BigDecimal uncertainty;
    @Column(name = "GAP")
    private BigDecimal gap;
    @Column(name = "DISTANCE")
    private BigDecimal distance;
    @Column(name = "QUALITY")
    private BigDecimal quality;
    @Column(name = "RFLAG")
    private String rflag;
    @Column(name = "LDDATE")
    @Temporal(TemporalType.DATE)
    private Date lddate;
    //@OneToMany(mappedBy = "prefmag")
    //private Collection<Event> eventCollection;
    @Column(name = "PREFMAG")
    private Long prefmag;
    public Netmag() {
    }

    public Netmag(Long magid) {
        this.magid = magid;
    }

    public Netmag(Long magid, long orid, BigDecimal magnitude, String magtype, String auth) {
        this.magid = magid;
        this.orid = orid;
        this.magnitude = magnitude;
        this.magtype = magtype;
        this.auth = auth;
    }

    public Long getMagid() {
        return magid;
    }

    public void setMagid(Long magid) {
        this.magid = magid;
    }

    public long getOrid() {
        return orid;
    }

    public void setOrid(long orid) {
        this.orid = orid;
    }

    public Long getCommid() {
        return commid;
    }

    public void setCommid(Long commid) {
        this.commid = commid;
    }

    public BigDecimal getMagnitude() {
        return magnitude;
    }

    public void setMagnitude(BigDecimal magnitude) {
        this.magnitude = magnitude;
    }

    public String getMagtype() {
        return magtype;
    }

    public void setMagtype(String magtype) {
        this.magtype = magtype;
    }

    public String getAuth() {
        return auth;
    }

    public void setAuth(String auth) {
        this.auth = auth;
    }

    public String getSubsource() {
        return subsource;
    }

    public void setSubsource(String subsource) {
        this.subsource = subsource;
    }

    public String getMagalgo() {
        return magalgo;
    }

    public void setMagalgo(String magalgo) {
        this.magalgo = magalgo;
    }

    public Integer getNsta() {
        return nsta;
    }

    public void setNsta(Integer nsta) {
        this.nsta = nsta;
    }

    public BigDecimal getUncertainty() {
        return uncertainty;
    }

    public void setUncertainty(BigDecimal uncertainty) {
        this.uncertainty = uncertainty;
    }

    public BigDecimal getGap() {
        return gap;
    }

    public void setGap(BigDecimal gap) {
        this.gap = gap;
    }

    public BigDecimal getDistance() {
        return distance;
    }

    public void setDistance(BigDecimal distance) {
        this.distance = distance;
    }

    public BigDecimal getQuality() {
        return quality;
    }

    public void setQuality(BigDecimal quality) {
        this.quality = quality;
    }

    public String getRflag() {
        return rflag;
    }

    public void setRflag(String rflag) {
        this.rflag = rflag;
    }

    public Date getLddate() {
        return lddate;
    }

    public void setLddate(Date lddate) {
        this.lddate = lddate;
    }
/*
    public Collection<Event> getEventCollection() {
        return eventCollection;
    }

    public void setEventCollection(Collection<Event> eventCollection) {
        this.eventCollection = eventCollection;
    }
*/
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (magid != null ? magid.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 Netmag)) {
            return false;
        }
        Netmag other = (Netmag) object;
        if ((this.magid == null && other.magid != null) || (this.magid != null && !this.magid.equals(other.magid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "TestRest.Netmag[magid=" + magid + "]";
    }

}
