/*
 * 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.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.TGENELABEL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenelabel.findAll", query = "SELECT t FROM Tgenelabel t"),
    @NamedQuery(name = "Tgenelabel.findByLabel", query = "SELECT t FROM Tgenelabel t WHERE t.tgenelabelPK.label = :label"),
    @NamedQuery(name = "Tgenelabel.findByLanguagecode", query = "SELECT t FROM Tgenelabel t WHERE t.tgenelabelPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenelabel.findByChannelcode", query = "SELECT t FROM Tgenelabel t WHERE t.tgenelabelPK.channelcode = :channelcode"),
    @NamedQuery(name = "Tgenelabel.findByRecordversion", query = "SELECT t FROM Tgenelabel t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenelabel.findByType", query = "SELECT t FROM Tgenelabel t WHERE t.type = :type"),
    @NamedQuery(name = "Tgenelabel.findByDescription", query = "SELECT t FROM Tgenelabel t WHERE t.description = :description")})
public class Tgenelabel implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenelabelPK tgenelabelPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "TYPE")
    private String type;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "CHANNELCODE", referencedColumnName = "CHANNELCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenechannels tgenechannels;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;

    public Tgenelabel() {
    }

    public Tgenelabel(TgenelabelPK tgenelabelPK) {
        this.tgenelabelPK = tgenelabelPK;
    }

    public Tgenelabel(String label, String languagecode, String channelcode) {
        this.tgenelabelPK = new TgenelabelPK(label, languagecode, channelcode);
    }

    public TgenelabelPK getTgenelabelPK() {
        return tgenelabelPK;
    }

    public void setTgenelabelPK(TgenelabelPK tgenelabelPK) {
        this.tgenelabelPK = tgenelabelPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

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

    public Tgenechannels getTgenechannels() {
        return tgenechannels;
    }

    public void setTgenechannels(Tgenechannels tgenechannels) {
        this.tgenechannels = tgenechannels;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

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

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

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