/*
 * 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.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEENTITY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneentity.findAll", query = "SELECT t FROM Tgeneentity t"),
    @NamedQuery(name = "Tgeneentity.findByTname", query = "SELECT t FROM Tgeneentity t WHERE t.tgeneentityPK.tname = :tname"),
    @NamedQuery(name = "Tgeneentity.findByEntity", query = "SELECT t FROM Tgeneentity t WHERE t.tgeneentityPK.entity = :entity"),
    @NamedQuery(name = "Tgeneentity.findByProject", query = "SELECT t FROM Tgeneentity t WHERE t.project = :project"),
    @NamedQuery(name = "Tgeneentity.findByPac", query = "SELECT t FROM Tgeneentity t WHERE t.pac = :pac"),
    @NamedQuery(name = "Tgeneentity.findByJavaextends", query = "SELECT t FROM Tgeneentity t WHERE t.javaextends = :javaextends"),
    @NamedQuery(name = "Tgeneentity.findByJavaimplements", query = "SELECT t FROM Tgeneentity t WHERE t.javaimplements = :javaimplements"),
    @NamedQuery(name = "Tgeneentity.findByCreatereferences", query = "SELECT t FROM Tgeneentity t WHERE t.createreferences = :createreferences"),
    @NamedQuery(name = "Tgeneentity.findByOptimisticlocking", query = "SELECT t FROM Tgeneentity t WHERE t.optimisticlocking = :optimisticlocking"),
    @NamedQuery(name = "Tgeneentity.findByHistory", query = "SELECT t FROM Tgeneentity t WHERE t.history = :history"),
    @NamedQuery(name = "Tgeneentity.findByAutoimport", query = "SELECT t FROM Tgeneentity t WHERE t.autoimport = :autoimport"),
    @NamedQuery(name = "Tgeneentity.findByInmanual", query = "SELECT t FROM Tgeneentity t WHERE t.inmanual = :inmanual"),
    @NamedQuery(name = "Tgeneentity.findByCache", query = "SELECT t FROM Tgeneentity t WHERE t.cache = :cache"),
    @NamedQuery(name = "Tgeneentity.findByLog", query = "SELECT t FROM Tgeneentity t WHERE t.log = :log")})
public class Tgeneentity implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneentityPK tgeneentityPK;
    @Column(name = "PROJECT")
    private String project;
    @Basic(optional = false)
    @Column(name = "PAC")
    private String pac;
    @Column(name = "JAVAEXTENDS")
    private String javaextends;
    @Column(name = "JAVAIMPLEMENTS")
    private String javaimplements;
    @Basic(optional = false)
    @Column(name = "CREATEREFERENCES")
    private String createreferences;
    @Basic(optional = false)
    @Column(name = "OPTIMISTICLOCKING")
    private String optimisticlocking;
    @Basic(optional = false)
    @Column(name = "HISTORY")
    private String history;
    @Column(name = "AUTOIMPORT")
    private String autoimport;
    @Column(name = "INMANUAL")
    private String inmanual;
    @Column(name = "CACHE")
    private String cache;
    @Column(name = "LOG")
    private String log;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgeneentity")
    private Collection<Tgenefields> tgenefieldsCollection;

    public Tgeneentity() {
    }

    public Tgeneentity(TgeneentityPK tgeneentityPK) {
        this.tgeneentityPK = tgeneentityPK;
    }

    public Tgeneentity(TgeneentityPK tgeneentityPK, String pac, String createreferences, String optimisticlocking, String history) {
        this.tgeneentityPK = tgeneentityPK;
        this.pac = pac;
        this.createreferences = createreferences;
        this.optimisticlocking = optimisticlocking;
        this.history = history;
    }

    public Tgeneentity(String tname, String entity) {
        this.tgeneentityPK = new TgeneentityPK(tname, entity);
    }

    public TgeneentityPK getTgeneentityPK() {
        return tgeneentityPK;
    }

    public void setTgeneentityPK(TgeneentityPK tgeneentityPK) {
        this.tgeneentityPK = tgeneentityPK;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getPac() {
        return pac;
    }

    public void setPac(String pac) {
        this.pac = pac;
    }

    public String getJavaextends() {
        return javaextends;
    }

    public void setJavaextends(String javaextends) {
        this.javaextends = javaextends;
    }

    public String getJavaimplements() {
        return javaimplements;
    }

    public void setJavaimplements(String javaimplements) {
        this.javaimplements = javaimplements;
    }

    public String getCreatereferences() {
        return createreferences;
    }

    public void setCreatereferences(String createreferences) {
        this.createreferences = createreferences;
    }

    public String getOptimisticlocking() {
        return optimisticlocking;
    }

    public void setOptimisticlocking(String optimisticlocking) {
        this.optimisticlocking = optimisticlocking;
    }

    public String getHistory() {
        return history;
    }

    public void setHistory(String history) {
        this.history = history;
    }

    public String getAutoimport() {
        return autoimport;
    }

    public void setAutoimport(String autoimport) {
        this.autoimport = autoimport;
    }

    public String getInmanual() {
        return inmanual;
    }

    public void setInmanual(String inmanual) {
        this.inmanual = inmanual;
    }

    public String getCache() {
        return cache;
    }

    public void setCache(String cache) {
        this.cache = cache;
    }

    public String getLog() {
        return log;
    }

    public void setLog(String log) {
        this.log = log;
    }

    @XmlTransient
    public Collection<Tgenefields> getTgenefieldsCollection() {
        return tgenefieldsCollection;
    }

    public void setTgenefieldsCollection(Collection<Tgenefields> tgenefieldsCollection) {
        this.tgenefieldsCollection = tgenefieldsCollection;
    }

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

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