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

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenemessagestructuredataPK tgenemessagestructuredataPK;
    @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 Tgenemessagestructuredata() {
    }

    public Tgenemessagestructuredata(TgenemessagestructuredataPK tgenemessagestructuredataPK) {
        this.tgenemessagestructuredataPK = tgenemessagestructuredataPK;
    }

    public Tgenemessagestructuredata(TgenemessagestructuredataPK tgenemessagestructuredataPK, String datatype) {
        this.tgenemessagestructuredataPK = tgenemessagestructuredataPK;
        this.datatype = datatype;
    }

    public Tgenemessagestructuredata(short code, String structurecode) {
        this.tgenemessagestructuredataPK = new TgenemessagestructuredataPK(code, structurecode);
    }

    public TgenemessagestructuredataPK getTgenemessagestructuredataPK() {
        return tgenemessagestructuredataPK;
    }

    public void setTgenemessagestructuredataPK(TgenemessagestructuredataPK tgenemessagestructuredataPK) {
        this.tgenemessagestructuredataPK = tgenemessagestructuredataPK;
    }

    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 += (tgenemessagestructuredataPK != null ? tgenemessagestructuredataPK.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 Tgenemessagestructuredata)) {
            return false;
        }
        Tgenemessagestructuredata other = (Tgenemessagestructuredata) object;
        if ((this.tgenemessagestructuredataPK == null && other.tgenemessagestructuredataPK != null) || (this.tgenemessagestructuredataPK != null && !this.tgenemessagestructuredataPK.equals(other.tgenemessagestructuredataPK))) {
            return false;
        }
        return true;
    }

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