/*
 * 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 javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TBPMPROCESSVARIABLES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmprocessvariables.findAll", query = "SELECT t FROM Tbpmprocessvariables t"),
    @NamedQuery(name = "Tbpmprocessvariables.findByJournalid", query = "SELECT t FROM Tbpmprocessvariables t WHERE t.tbpmprocessvariablesPK.journalid = :journalid"),
    @NamedQuery(name = "Tbpmprocessvariables.findByName", query = "SELECT t FROM Tbpmprocessvariables t WHERE t.tbpmprocessvariablesPK.name = :name")})
public class Tbpmprocessvariables implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TbpmprocessvariablesPK tbpmprocessvariablesPK;
    @Basic(optional = false)
    @Lob
    @Column(name = "CONTENT")
    private String content;
    @JoinColumn(name = "JOURNALID", referencedColumnName = "JOURNALID", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tbpmprocessinstance tbpmprocessinstance;

    public Tbpmprocessvariables() {
    }

    public Tbpmprocessvariables(TbpmprocessvariablesPK tbpmprocessvariablesPK) {
        this.tbpmprocessvariablesPK = tbpmprocessvariablesPK;
    }

    public Tbpmprocessvariables(TbpmprocessvariablesPK tbpmprocessvariablesPK, String content) {
        this.tbpmprocessvariablesPK = tbpmprocessvariablesPK;
        this.content = content;
    }

    public Tbpmprocessvariables(String journalid, String name) {
        this.tbpmprocessvariablesPK = new TbpmprocessvariablesPK(journalid, name);
    }

    public TbpmprocessvariablesPK getTbpmprocessvariablesPK() {
        return tbpmprocessvariablesPK;
    }

    public void setTbpmprocessvariablesPK(TbpmprocessvariablesPK tbpmprocessvariablesPK) {
        this.tbpmprocessvariablesPK = tbpmprocessvariablesPK;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Tbpmprocessinstance getTbpmprocessinstance() {
        return tbpmprocessinstance;
    }

    public void setTbpmprocessinstance(Tbpmprocessinstance tbpmprocessinstance) {
        this.tbpmprocessinstance = tbpmprocessinstance;
    }

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

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