/*
 * 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.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.TSAFEPROFILEHORARY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeprofilehorary.findAll", query = "SELECT t FROM Tsafeprofilehorary t"),
    @NamedQuery(name = "Tsafeprofilehorary.findByProfilecode", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.tsafeprofilehoraryPK.profilecode = :profilecode"),
    @NamedQuery(name = "Tsafeprofilehorary.findByTransactionmodule", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.tsafeprofilehoraryPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tsafeprofilehorary.findByTransactioncode", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.tsafeprofilehoraryPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tsafeprofilehorary.findByTransactionversion", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.tsafeprofilehoraryPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tsafeprofilehorary.findByDay", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.tsafeprofilehoraryPK.day = :day"),
    @NamedQuery(name = "Tsafeprofilehorary.findByRegistercode", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.registercode = :registercode"),
    @NamedQuery(name = "Tsafeprofilehorary.findByRecordversion", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tsafeprofilehorary.findByInittime", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.inittime = :inittime"),
    @NamedQuery(name = "Tsafeprofilehorary.findByFinishtime", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.finishtime = :finishtime"),
    @NamedQuery(name = "Tsafeprofilehorary.findByValidateamount", query = "SELECT t FROM Tsafeprofilehorary t WHERE t.validateamount = :validateamount")})
public class Tsafeprofilehorary implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TsafeprofilehoraryPK tsafeprofilehoraryPK;
    @Basic(optional = false)
    @Column(name = "REGISTERCODE")
    private String registercode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "INITTIME")
    private String inittime;
    @Basic(optional = false)
    @Column(name = "FINISHTIME")
    private String finishtime;
    @Column(name = "VALIDATEAMOUNT")
    private String validateamount;
    @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;
    @JoinColumn(name = "PROFILECODE", referencedColumnName = "PROFILECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tsafeprofile tsafeprofile;

    public Tsafeprofilehorary() {
    }

    public Tsafeprofilehorary(TsafeprofilehoraryPK tsafeprofilehoraryPK) {
        this.tsafeprofilehoraryPK = tsafeprofilehoraryPK;
    }

    public Tsafeprofilehorary(TsafeprofilehoraryPK tsafeprofilehoraryPK, String registercode, String inittime, String finishtime) {
        this.tsafeprofilehoraryPK = tsafeprofilehoraryPK;
        this.registercode = registercode;
        this.inittime = inittime;
        this.finishtime = finishtime;
    }

    public Tsafeprofilehorary(String profilecode, String transactionmodule, short transactioncode, short transactionversion, short day) {
        this.tsafeprofilehoraryPK = new TsafeprofilehoraryPK(profilecode, transactionmodule, transactioncode, transactionversion, day);
    }

    public TsafeprofilehoraryPK getTsafeprofilehoraryPK() {
        return tsafeprofilehoraryPK;
    }

    public void setTsafeprofilehoraryPK(TsafeprofilehoraryPK tsafeprofilehoraryPK) {
        this.tsafeprofilehoraryPK = tsafeprofilehoraryPK;
    }

    public String getRegistercode() {
        return registercode;
    }

    public void setRegistercode(String registercode) {
        this.registercode = registercode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getInittime() {
        return inittime;
    }

    public void setInittime(String inittime) {
        this.inittime = inittime;
    }

    public String getFinishtime() {
        return finishtime;
    }

    public void setFinishtime(String finishtime) {
        this.finishtime = finishtime;
    }

    public String getValidateamount() {
        return validateamount;
    }

    public void setValidateamount(String validateamount) {
        this.validateamount = validateamount;
    }

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

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

    public Tsafeprofile getTsafeprofile() {
        return tsafeprofile;
    }

    public void setTsafeprofile(Tsafeprofile tsafeprofile) {
        this.tsafeprofile = tsafeprofile;
    }

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

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