/*
 * 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.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
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.TBPMFIELDTRANSACTIONMAPING")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findAll", query = "SELECT t FROM Tbpmfieldtransactionmaping t"),
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findByTransactionmodule", query = "SELECT t FROM Tbpmfieldtransactionmaping t WHERE t.tbpmfieldtransactionmapingPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findByTransactioncode", query = "SELECT t FROM Tbpmfieldtransactionmaping t WHERE t.tbpmfieldtransactionmapingPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findByTransactionversion", query = "SELECT t FROM Tbpmfieldtransactionmaping t WHERE t.tbpmfieldtransactionmapingPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findByFieldname", query = "SELECT t FROM Tbpmfieldtransactionmaping t WHERE t.tbpmfieldtransactionmapingPK.fieldname = :fieldname"),
    @NamedQuery(name = "Tbpmfieldtransactionmaping.findByFieldscreen", query = "SELECT t FROM Tbpmfieldtransactionmaping t WHERE t.fieldscreen = :fieldscreen")})
public class Tbpmfieldtransactionmaping implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TbpmfieldtransactionmapingPK tbpmfieldtransactionmapingPK;
    @Column(name = "FIELDSCREEN")
    private String fieldscreen;
    @JoinColumn(name = "FIELDNAME", referencedColumnName = "FIELDNAME", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tbpmfield tbpmfield;
    @JoinColumns({
        @JoinColumn(name = "TRANSACTIONMODULE", referencedColumnName = "TRANSACTIONMODULE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONCODE", referencedColumnName = "TRANSACTIONCODE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONVERSION", referencedColumnName = "TRANSACTIONVERSION", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenetransaction tgenetransaction;

    public Tbpmfieldtransactionmaping() {
    }

    public Tbpmfieldtransactionmaping(TbpmfieldtransactionmapingPK tbpmfieldtransactionmapingPK) {
        this.tbpmfieldtransactionmapingPK = tbpmfieldtransactionmapingPK;
    }

    public Tbpmfieldtransactionmaping(String transactionmodule, short transactioncode, short transactionversion, String fieldname) {
        this.tbpmfieldtransactionmapingPK = new TbpmfieldtransactionmapingPK(transactionmodule, transactioncode, transactionversion, fieldname);
    }

    public TbpmfieldtransactionmapingPK getTbpmfieldtransactionmapingPK() {
        return tbpmfieldtransactionmapingPK;
    }

    public void setTbpmfieldtransactionmapingPK(TbpmfieldtransactionmapingPK tbpmfieldtransactionmapingPK) {
        this.tbpmfieldtransactionmapingPK = tbpmfieldtransactionmapingPK;
    }

    public String getFieldscreen() {
        return fieldscreen;
    }

    public void setFieldscreen(String fieldscreen) {
        this.fieldscreen = fieldscreen;
    }

    public Tbpmfield getTbpmfield() {
        return tbpmfield;
    }

    public void setTbpmfield(Tbpmfield tbpmfield) {
        this.tbpmfield = tbpmfield;
    }

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

    public void setTgenetransaction(Tgenetransaction tgenetransaction) {
        this.tgenetransaction = tgenetransaction;
    }

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

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