/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TBPMACTIVITIES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmactivities.findAll", query = "SELECT t FROM Tbpmactivities t"),
    @NamedQuery(name = "Tbpmactivities.findByJournalid", query = "SELECT t FROM Tbpmactivities t WHERE t.tbpmactivitiesPK.journalid = :journalid"),
    @NamedQuery(name = "Tbpmactivities.findByActivityname", query = "SELECT t FROM Tbpmactivities t WHERE t.tbpmactivitiesPK.activityname = :activityname"),
    @NamedQuery(name = "Tbpmactivities.findBySequence", query = "SELECT t FROM Tbpmactivities t WHERE t.tbpmactivitiesPK.sequence = :sequence"),
    @NamedQuery(name = "Tbpmactivities.findByAction", query = "SELECT t FROM Tbpmactivities t WHERE t.action = :action"),
    @NamedQuery(name = "Tbpmactivities.findByCompleted", query = "SELECT t FROM Tbpmactivities t WHERE t.completed = :completed"),
    @NamedQuery(name = "Tbpmactivities.findByCreated", query = "SELECT t FROM Tbpmactivities t WHERE t.created = :created"),
    @NamedQuery(name = "Tbpmactivities.findByExpectedtime", query = "SELECT t FROM Tbpmactivities t WHERE t.expectedtime = :expectedtime"),
    @NamedQuery(name = "Tbpmactivities.findByTaskjournalid", query = "SELECT t FROM Tbpmactivities t WHERE t.taskjournalid = :taskjournalid"),
    @NamedQuery(name = "Tbpmactivities.findByResponse", query = "SELECT t FROM Tbpmactivities t WHERE t.response = :response"),
    @NamedQuery(name = "Tbpmactivities.findByStarted", query = "SELECT t FROM Tbpmactivities t WHERE t.started = :started"),
    @NamedQuery(name = "Tbpmactivities.findByTaskid", query = "SELECT t FROM Tbpmactivities t WHERE t.taskid = :taskid"),
    @NamedQuery(name = "Tbpmactivities.findByModule", query = "SELECT t FROM Tbpmactivities t WHERE t.module = :module"),
    @NamedQuery(name = "Tbpmactivities.findByTransaction", query = "SELECT t FROM Tbpmactivities t WHERE t.transaction = :transaction"),
    @NamedQuery(name = "Tbpmactivities.findByVersion", query = "SELECT t FROM Tbpmactivities t WHERE t.version = :version"),
    @NamedQuery(name = "Tbpmactivities.findByInternalcode", query = "SELECT t FROM Tbpmactivities t WHERE t.internalcode = :internalcode"),
    @NamedQuery(name = "Tbpmactivities.findByPackagename", query = "SELECT t FROM Tbpmactivities t WHERE t.packagename = :packagename"),
    @NamedQuery(name = "Tbpmactivities.findByPackagenamedefault", query = "SELECT t FROM Tbpmactivities t WHERE t.packagenamedefault = :packagenamedefault")})
public class Tbpmactivities implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TbpmactivitiesPK tbpmactivitiesPK;
    @Column(name = "ACTION")
    private String action;
    @Lob
    @Column(name = "ADITIONALDATA")
    private String aditionaldata;
    @Column(name = "COMPLETED")
    @Temporal(TemporalType.TIMESTAMP)
    private Date completed;
    @Column(name = "CREATED")
    @Temporal(TemporalType.TIMESTAMP)
    private Date created;
    @Column(name = "EXPECTEDTIME")
    private BigInteger expectedtime;
    @Column(name = "TASKJOURNALID")
    private String taskjournalid;
    @Column(name = "RESPONSE")
    private String response;
    @Column(name = "STARTED")
    @Temporal(TemporalType.TIMESTAMP)
    private Date started;
    @Column(name = "TASKID")
    private BigInteger taskid;
    @Column(name = "MODULE")
    private String module;
    @Column(name = "TRANSACTION")
    private BigInteger transaction;
    @Column(name = "VERSION")
    private BigInteger version;
    @Column(name = "INTERNALCODE")
    private String internalcode;
    @Column(name = "PACKAGENAME")
    private String packagename;
    @Column(name = "PACKAGENAMEDEFAULT")
    private String packagenamedefault;
    @JoinColumns({
        @JoinColumn(name = "GROUPCODE", referencedColumnName = "GROUPCODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")})
    @ManyToOne
    private Tbpmgroups tbpmgroups;
    @JoinColumns({
        @JoinColumn(name = "RULECODEDEFAULT", referencedColumnName = "RULECODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")})
    @ManyToOne
    private Tbpmrules tbpmrules;
    @JoinColumns({
        @JoinColumn(name = "RULECODE", referencedColumnName = "RULECODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")})
    @ManyToOne
    private Tbpmrules tbpmrules1;
    @JoinColumn(name = "USERCODE", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser usercode;

    public Tbpmactivities() {
    }

    public Tbpmactivities(TbpmactivitiesPK tbpmactivitiesPK) {
        this.tbpmactivitiesPK = tbpmactivitiesPK;
    }

    public Tbpmactivities(String journalid, String activityname, long sequence) {
        this.tbpmactivitiesPK = new TbpmactivitiesPK(journalid, activityname, sequence);
    }

    public TbpmactivitiesPK getTbpmactivitiesPK() {
        return tbpmactivitiesPK;
    }

    public void setTbpmactivitiesPK(TbpmactivitiesPK tbpmactivitiesPK) {
        this.tbpmactivitiesPK = tbpmactivitiesPK;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getAditionaldata() {
        return aditionaldata;
    }

    public void setAditionaldata(String aditionaldata) {
        this.aditionaldata = aditionaldata;
    }

    public Date getCompleted() {
        return completed;
    }

    public void setCompleted(Date completed) {
        this.completed = completed;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public BigInteger getExpectedtime() {
        return expectedtime;
    }

    public void setExpectedtime(BigInteger expectedtime) {
        this.expectedtime = expectedtime;
    }

    public String getTaskjournalid() {
        return taskjournalid;
    }

    public void setTaskjournalid(String taskjournalid) {
        this.taskjournalid = taskjournalid;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public Date getStarted() {
        return started;
    }

    public void setStarted(Date started) {
        this.started = started;
    }

    public BigInteger getTaskid() {
        return taskid;
    }

    public void setTaskid(BigInteger taskid) {
        this.taskid = taskid;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public BigInteger getTransaction() {
        return transaction;
    }

    public void setTransaction(BigInteger transaction) {
        this.transaction = transaction;
    }

    public BigInteger getVersion() {
        return version;
    }

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

    public String getInternalcode() {
        return internalcode;
    }

    public void setInternalcode(String internalcode) {
        this.internalcode = internalcode;
    }

    public String getPackagename() {
        return packagename;
    }

    public void setPackagename(String packagename) {
        this.packagename = packagename;
    }

    public String getPackagenamedefault() {
        return packagenamedefault;
    }

    public void setPackagenamedefault(String packagenamedefault) {
        this.packagenamedefault = packagenamedefault;
    }

    public Tbpmgroups getTbpmgroups() {
        return tbpmgroups;
    }

    public void setTbpmgroups(Tbpmgroups tbpmgroups) {
        this.tbpmgroups = tbpmgroups;
    }

    public Tbpmrules getTbpmrules() {
        return tbpmrules;
    }

    public void setTbpmrules(Tbpmrules tbpmrules) {
        this.tbpmrules = tbpmrules;
    }

    public Tbpmrules getTbpmrules1() {
        return tbpmrules1;
    }

    public void setTbpmrules1(Tbpmrules tbpmrules1) {
        this.tbpmrules1 = tbpmrules1;
    }

    public Tsafeuser getUsercode() {
        return usercode;
    }

    public void setUsercode(Tsafeuser usercode) {
        this.usercode = usercode;
    }

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

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tbpmactivities[ tbpmactivitiesPK=" + tbpmactivitiesPK + " ]";
    }
    
}
