/*
 * 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.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
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.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTCOMPANYMANAGERS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustcompanymanagers.findAll", query = "SELECT t FROM Tcustcompanymanagers t"),
    @NamedQuery(name = "Tcustcompanymanagers.findByPersoncode", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.tcustcompanymanagersPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustcompanymanagers.findByDateto", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.tcustcompanymanagersPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustcompanymanagers.findByManagerpersoncode", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.tcustcompanymanagersPK.managerpersoncode = :managerpersoncode"),
    @NamedQuery(name = "Tcustcompanymanagers.findByAppointmentcatalog", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.tcustcompanymanagersPK.appointmentcatalog = :appointmentcatalog"),
    @NamedQuery(name = "Tcustcompanymanagers.findByAppointmentcatalogcode", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.tcustcompanymanagersPK.appointmentcatalogcode = :appointmentcatalogcode"),
    @NamedQuery(name = "Tcustcompanymanagers.findByDatefrom", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustcompanymanagers.findByRecordversion", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustcompanymanagers.findByDesignationdate", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.designationdate = :designationdate"),
    @NamedQuery(name = "Tcustcompanymanagers.findByExpirationdate", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.expirationdate = :expirationdate"),
    @NamedQuery(name = "Tcustcompanymanagers.findByRegisterdate", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.registerdate = :registerdate"),
    @NamedQuery(name = "Tcustcompanymanagers.findByRemark", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.remark = :remark"),
    @NamedQuery(name = "Tcustcompanymanagers.findByIngressuser", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcustcompanymanagers.findByModifyuser", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.modifyuser = :modifyuser"),
    @NamedQuery(name = "Tcustcompanymanagers.findByIsrepresentlegal", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.isrepresentlegal = :isrepresentlegal"),
    @NamedQuery(name = "Tcustcompanymanagers.findByParticipation", query = "SELECT t FROM Tcustcompanymanagers t WHERE t.participation = :participation")})
public class Tcustcompanymanagers implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustcompanymanagersPK tcustcompanymanagersPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESIGNATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date designationdate;
    @Column(name = "EXPIRATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date expirationdate;
    @Column(name = "REGISTERDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date registerdate;
    @Column(name = "REMARK")
    private String remark;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @Column(name = "ISREPRESENTLEGAL")
    private String isrepresentlegal;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PARTICIPATION")
    private BigDecimal participation;
    @JoinColumn(name = "MANAGERPERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson1;
    @JoinColumns({
        @JoinColumn(name = "APPOINTMENTCATALOG", referencedColumnName = "CATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "APPOINTMENTCATALOGCODE", referencedColumnName = "CATALOGCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tcustcompanymanagers() {
    }

    public Tcustcompanymanagers(TcustcompanymanagersPK tcustcompanymanagersPK) {
        this.tcustcompanymanagersPK = tcustcompanymanagersPK;
    }

    public Tcustcompanymanagers(long personcode, Date dateto, long managerpersoncode, String appointmentcatalog, String appointmentcatalogcode) {
        this.tcustcompanymanagersPK = new TcustcompanymanagersPK(personcode, dateto, managerpersoncode, appointmentcatalog, appointmentcatalogcode);
    }

    public TcustcompanymanagersPK getTcustcompanymanagersPK() {
        return tcustcompanymanagersPK;
    }

    public void setTcustcompanymanagersPK(TcustcompanymanagersPK tcustcompanymanagersPK) {
        this.tcustcompanymanagersPK = tcustcompanymanagersPK;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Date getDesignationdate() {
        return designationdate;
    }

    public void setDesignationdate(Date designationdate) {
        this.designationdate = designationdate;
    }

    public Date getExpirationdate() {
        return expirationdate;
    }

    public void setExpirationdate(Date expirationdate) {
        this.expirationdate = expirationdate;
    }

    public Date getRegisterdate() {
        return registerdate;
    }

    public void setRegisterdate(Date registerdate) {
        this.registerdate = registerdate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(String ingressuser) {
        this.ingressuser = ingressuser;
    }

    public String getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(String modifyuser) {
        this.modifyuser = modifyuser;
    }

    public String getIsrepresentlegal() {
        return isrepresentlegal;
    }

    public void setIsrepresentlegal(String isrepresentlegal) {
        this.isrepresentlegal = isrepresentlegal;
    }

    public BigDecimal getParticipation() {
        return participation;
    }

    public void setParticipation(BigDecimal participation) {
        this.participation = participation;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

    public void setTcustperson(Tcustperson tcustperson) {
        this.tcustperson = tcustperson;
    }

    public Tcustperson getTcustperson1() {
        return tcustperson1;
    }

    public void setTcustperson1(Tcustperson tcustperson1) {
        this.tcustperson1 = tcustperson1;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

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

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