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

package TestRest;

import java.io.Serializable;
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.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author aparnab
 */
@Entity
@Table(name = "EVENT")
@NamedQueries({@NamedQuery(name = "Event.findAll", query = "SELECT e FROM Event e"), @NamedQuery(name = "Event.findByEvid", query = "SELECT e FROM Event e WHERE e.evid = :evid")})//, @NamedQuery(name = "Event.findByCommid", query = "SELECT e FROM Event e WHERE e.commid = :commid"), @NamedQuery(name = "Event.findByAuth", query = "SELECT e FROM Event e WHERE e.auth = :auth"), @NamedQuery(name = "Event.findBySubsource", query = "SELECT e FROM Event e WHERE e.subsource = :subsource"), @NamedQuery(name = "Event.findByEtype", query = "SELECT e FROM Event e WHERE e.etype = :etype"), @NamedQuery(name = "Event.findBySelectflag", query = "SELECT e FROM Event e WHERE e.selectflag = :selectflag"), @NamedQuery(name = "Event.findByVersion", query = "SELECT e FROM Event e WHERE e.version = :version"), @NamedQuery(name = "Event.findByLddate", query = "SELECT e FROM Event e WHERE e.lddate = :lddate")})
public class Event implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "EVID")
    private Long evid;
    @Column(name = "COMMID")
    private Long commid;
    @Basic(optional = false)
    @Column(name = "AUTH", nullable = false)
    private String auth;
    @Column(name = "SUBSOURCE")
    private String subsource;
    @Column(name = "ETYPE")
    private String etype;
    @Column(name = "SELECTFLAG")
    private Short selectflag;
    @Column(name = "VERSION")
    private Long version;
    @Column(name = "LDDATE")
    @Temporal(TemporalType.DATE)
    private Date lddate;

    public Event() {
    }

    public Event(Long evid) {
        this.evid = evid;
    }

    public Event(Long evid, String auth) {
        this.evid = evid;
        this.auth = auth;
    }

    public Long getEvid() {
        return evid;
    }

    public void setEvid(Long evid) {
        this.evid = evid;
    }

    public Long getCommid() {
        return commid;
    }

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

    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 getEtype() {
        return etype;
    }

    public void setEtype(String etype) {
        this.etype = etype;
    }

    public Short getSelectflag() {
        return selectflag;
    }

    public void setSelectflag(Short selectflag) {
        this.selectflag = selectflag;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public Date getLddate() {
        return lddate;
    }

    public void setLddate(Date lddate) {
        this.lddate = lddate;
    }

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

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

}
