/*
 * 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.Basic;
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.TGENEMESSAGESTRUCTUREHEADER")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenemessagestructureheader.findAll", query = "SELECT t FROM Tgenemessagestructureheader t"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByCode", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.tgenemessagestructureheaderPK.code = :code"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByStructurecode", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.tgenemessagestructureheaderPK.structurecode = :structurecode"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByDescription", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByRecordversion", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByDatatype", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.datatype = :datatype"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByLength", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.length = :length"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByRequired", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.required = :required"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByInitposition", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.initposition = :initposition"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByEndposition", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.endposition = :endposition"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByDecimalnumber", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.decimalnumber = :decimalnumber"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByInitvalue", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.initvalue = :initvalue"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByFillercharacter", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.fillercharacter = :fillercharacter"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByLeftrefiller", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.leftrefiller = :leftrefiller"),
    @NamedQuery(name = "Tgenemessagestructureheader.findByAttribute", query = "SELECT t FROM Tgenemessagestructureheader t WHERE t.attribute = :attribute")})
public class Tgenemessagestructureheader implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenemessagestructureheaderPK tgenemessagestructureheaderPK;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DATATYPE")
    private String datatype;
    @Column(name = "LENGTH")
    private Short length;
    @Column(name = "REQUIRED")
    private String required;
    @Column(name = "INITPOSITION")
    private Short initposition;
    @Column(name = "ENDPOSITION")
    private Short endposition;
    @Column(name = "DECIMALNUMBER")
    private Short decimalnumber;
    @Column(name = "INITVALUE")
    private String initvalue;
    @Column(name = "FILLERCHARACTER")
    private String fillercharacter;
    @Column(name = "LEFTREFILLER")
    private String leftrefiller;
    @Column(name = "ATTRIBUTE")
    private String attribute;
    @JoinColumn(name = "STRUCTURECODE", referencedColumnName = "STRUCTURECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenemessagestructure tgenemessagestructure;

    public Tgenemessagestructureheader() {
    }

    public Tgenemessagestructureheader(TgenemessagestructureheaderPK tgenemessagestructureheaderPK) {
        this.tgenemessagestructureheaderPK = tgenemessagestructureheaderPK;
    }

    public Tgenemessagestructureheader(TgenemessagestructureheaderPK tgenemessagestructureheaderPK, String datatype) {
        this.tgenemessagestructureheaderPK = tgenemessagestructureheaderPK;
        this.datatype = datatype;
    }

    public Tgenemessagestructureheader(short code, String structurecode) {
        this.tgenemessagestructureheaderPK = new TgenemessagestructureheaderPK(code, structurecode);
    }

    public TgenemessagestructureheaderPK getTgenemessagestructureheaderPK() {
        return tgenemessagestructureheaderPK;
    }

    public void setTgenemessagestructureheaderPK(TgenemessagestructureheaderPK tgenemessagestructureheaderPK) {
        this.tgenemessagestructureheaderPK = tgenemessagestructureheaderPK;
    }

    public String getDescription() {
        return description;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDatatype() {
        return datatype;
    }

    public void setDatatype(String datatype) {
        this.datatype = datatype;
    }

    public Short getLength() {
        return length;
    }

    public void setLength(Short length) {
        this.length = length;
    }

    public String getRequired() {
        return required;
    }

    public void setRequired(String required) {
        this.required = required;
    }

    public Short getInitposition() {
        return initposition;
    }

    public void setInitposition(Short initposition) {
        this.initposition = initposition;
    }

    public Short getEndposition() {
        return endposition;
    }

    public void setEndposition(Short endposition) {
        this.endposition = endposition;
    }

    public Short getDecimalnumber() {
        return decimalnumber;
    }

    public void setDecimalnumber(Short decimalnumber) {
        this.decimalnumber = decimalnumber;
    }

    public String getInitvalue() {
        return initvalue;
    }

    public void setInitvalue(String initvalue) {
        this.initvalue = initvalue;
    }

    public String getFillercharacter() {
        return fillercharacter;
    }

    public void setFillercharacter(String fillercharacter) {
        this.fillercharacter = fillercharacter;
    }

    public String getLeftrefiller() {
        return leftrefiller;
    }

    public void setLeftrefiller(String leftrefiller) {
        this.leftrefiller = leftrefiller;
    }

    public String getAttribute() {
        return attribute;
    }

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    public Tgenemessagestructure getTgenemessagestructure() {
        return tgenemessagestructure;
    }

    public void setTgenemessagestructure(Tgenemessagestructure tgenemessagestructure) {
        this.tgenemessagestructure = tgenemessagestructure;
    }

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

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