/*
 * 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.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
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.TBPMTASKCOMMENTS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmtaskcomments.findAll", query = "SELECT t FROM Tbpmtaskcomments t"),
    @NamedQuery(name = "Tbpmtaskcomments.findById", query = "SELECT t FROM Tbpmtaskcomments t WHERE t.id = :id"),
    @NamedQuery(name = "Tbpmtaskcomments.findByAdded", query = "SELECT t FROM Tbpmtaskcomments t WHERE t.added = :added"),
    @NamedQuery(name = "Tbpmtaskcomments.findByText", query = "SELECT t FROM Tbpmtaskcomments t WHERE t.text = :text"),
    @NamedQuery(name = "Tbpmtaskcomments.findByTaskid", query = "SELECT t FROM Tbpmtaskcomments t WHERE t.taskid = :taskid")})
public class Tbpmtaskcomments implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Basic(optional = false)
    @Column(name = "ADDED")
    @Temporal(TemporalType.TIMESTAMP)
    private Date added;
    @Basic(optional = false)
    @Column(name = "TEXT")
    private String text;
    @Basic(optional = false)
    @Column(name = "TASKID")
    private BigInteger taskid;
    @JoinColumn(name = "USERCODE", referencedColumnName = "USERCODE")
    @ManyToOne
    private Tsafeuser usercode;

    public Tbpmtaskcomments() {
    }

    public Tbpmtaskcomments(BigDecimal id) {
        this.id = id;
    }

    public Tbpmtaskcomments(BigDecimal id, Date added, String text, BigInteger taskid) {
        this.id = id;
        this.added = added;
        this.text = text;
        this.taskid = taskid;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public Date getAdded() {
        return added;
    }

    public void setAdded(Date added) {
        this.added = added;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public BigInteger getTaskid() {
        return taskid;
    }

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

    public Tsafeuser getUsercode() {
        return usercode;
    }

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

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

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