/*
 * 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 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.TGENEMESSAGETEMPLATESDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemessagetemplatesdesc.findAll", query = "SELECT t FROM Tgenemessagetemplatesdesc t"),
    @NamedQuery(name = "Tgenemessagetemplatesdesc.findByCode", query = "SELECT t FROM Tgenemessagetemplatesdesc t WHERE t.tgenemessagetemplatesdescPK.code = :code"),
    @NamedQuery(name = "Tgenemessagetemplatesdesc.findByLanguagecode", query = "SELECT t FROM Tgenemessagetemplatesdesc t WHERE t.tgenemessagetemplatesdescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenemessagetemplatesdesc.findByRecordversion", query = "SELECT t FROM Tgenemessagetemplatesdesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenemessagetemplatesdesc.findByDescription", query = "SELECT t FROM Tgenemessagetemplatesdesc t WHERE t.description = :description")})
public class Tgenemessagetemplatesdesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenemessagetemplatesdescPK tgenemessagetemplatesdescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @Lob
    @Column(name = "TEMPLATE")
    private String template;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;
    @JoinColumn(name = "CODE", referencedColumnName = "CODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenemessagetemplates tgenemessagetemplates;

    public Tgenemessagetemplatesdesc() {
    }

    public Tgenemessagetemplatesdesc(TgenemessagetemplatesdescPK tgenemessagetemplatesdescPK) {
        this.tgenemessagetemplatesdescPK = tgenemessagetemplatesdescPK;
    }

    public Tgenemessagetemplatesdesc(short code, String languagecode) {
        this.tgenemessagetemplatesdescPK = new TgenemessagetemplatesdescPK(code, languagecode);
    }

    public TgenemessagetemplatesdescPK getTgenemessagetemplatesdescPK() {
        return tgenemessagetemplatesdescPK;
    }

    public void setTgenemessagetemplatesdescPK(TgenemessagetemplatesdescPK tgenemessagetemplatesdescPK) {
        this.tgenemessagetemplatesdescPK = tgenemessagetemplatesdescPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

    public void setTgenelanguage(Tgenelanguage tgenelanguage) {
        this.tgenelanguage = tgenelanguage;
    }

    public Tgenemessagetemplates getTgenemessagetemplates() {
        return tgenemessagetemplates;
    }

    public void setTgenemessagetemplates(Tgenemessagetemplates tgenemessagetemplates) {
        this.tgenemessagetemplates = tgenemessagetemplates;
    }

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

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