/*
 * 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.TCUSTPEOPLEVEHICLE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeoplevehicle.findAll", query = "SELECT t FROM Tcustpeoplevehicle t"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPersoncode", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.tcustpeoplevehiclePK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByDateto", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.tcustpeoplevehiclePK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByVehiclesequence", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.tcustpeoplevehiclePK.vehiclesequence = :vehiclesequence"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByDatefrom", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByRecordversion", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByModel", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.model = :model"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByYear", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.year = :year"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByMotorid", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.motorid = :motorid"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPlate", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.plate = :plate"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByColor", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.color = :color"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByAssessment", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.assessment = :assessment"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByInpuntamount", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.inpuntamount = :inpuntamount"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPledgedamount", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.pledgedamount = :pledgedamount"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPledgeddate", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.pledgeddate = :pledgeddate"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPledgedbalance", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.pledgedbalance = :pledgedbalance"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByPledgedname", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.pledgedname = :pledgedname"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByRemark", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.remark = :remark"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByIngressusercode", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeoplevehicle.findByModifyusercode", query = "SELECT t FROM Tcustpeoplevehicle t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeoplevehicle implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeoplevehiclePK tcustpeoplevehiclePK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "MODEL")
    private String model;
    @Column(name = "YEAR")
    private String year;
    @Column(name = "MOTORID")
    private String motorid;
    @Column(name = "PLATE")
    private String plate;
    @Column(name = "COLOR")
    private String color;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ASSESSMENT")
    private BigDecimal assessment;
    @Column(name = "INPUNTAMOUNT")
    private BigDecimal inpuntamount;
    @Column(name = "PLEDGEDAMOUNT")
    private BigDecimal pledgedamount;
    @Column(name = "PLEDGEDDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pledgeddate;
    @Column(name = "PLEDGEDBALANCE")
    private BigDecimal pledgedbalance;
    @Column(name = "PLEDGEDNAME")
    private String pledgedname;
    @Column(name = "REMARK")
    private String remark;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumn(name = "PLEDGEDPERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson pledgedpersoncode;
    @JoinColumns({
        @JoinColumn(name = "VEHICLETYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "VEHICLETYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "CARBRANDSCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CARBRANDSCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;

    public Tcustpeoplevehicle() {
    }

    public Tcustpeoplevehicle(TcustpeoplevehiclePK tcustpeoplevehiclePK) {
        this.tcustpeoplevehiclePK = tcustpeoplevehiclePK;
    }

    public Tcustpeoplevehicle(long personcode, Date dateto, short vehiclesequence) {
        this.tcustpeoplevehiclePK = new TcustpeoplevehiclePK(personcode, dateto, vehiclesequence);
    }

    public TcustpeoplevehiclePK getTcustpeoplevehiclePK() {
        return tcustpeoplevehiclePK;
    }

    public void setTcustpeoplevehiclePK(TcustpeoplevehiclePK tcustpeoplevehiclePK) {
        this.tcustpeoplevehiclePK = tcustpeoplevehiclePK;
    }

    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 String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getMotorid() {
        return motorid;
    }

    public void setMotorid(String motorid) {
        this.motorid = motorid;
    }

    public String getPlate() {
        return plate;
    }

    public void setPlate(String plate) {
        this.plate = plate;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public BigDecimal getAssessment() {
        return assessment;
    }

    public void setAssessment(BigDecimal assessment) {
        this.assessment = assessment;
    }

    public BigDecimal getInpuntamount() {
        return inpuntamount;
    }

    public void setInpuntamount(BigDecimal inpuntamount) {
        this.inpuntamount = inpuntamount;
    }

    public BigDecimal getPledgedamount() {
        return pledgedamount;
    }

    public void setPledgedamount(BigDecimal pledgedamount) {
        this.pledgedamount = pledgedamount;
    }

    public Date getPledgeddate() {
        return pledgeddate;
    }

    public void setPledgeddate(Date pledgeddate) {
        this.pledgeddate = pledgeddate;
    }

    public BigDecimal getPledgedbalance() {
        return pledgedbalance;
    }

    public void setPledgedbalance(BigDecimal pledgedbalance) {
        this.pledgedbalance = pledgedbalance;
    }

    public String getPledgedname() {
        return pledgedname;
    }

    public void setPledgedname(String pledgedname) {
        this.pledgedname = pledgedname;
    }

    public String getRemark() {
        return remark;
    }

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

    public String getIngressusercode() {
        return ingressusercode;
    }

    public void setIngressusercode(String ingressusercode) {
        this.ingressusercode = ingressusercode;
    }

    public String getModifyusercode() {
        return modifyusercode;
    }

    public void setModifyusercode(String modifyusercode) {
        this.modifyusercode = modifyusercode;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

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

    public Tcustperson getPledgedpersoncode() {
        return pledgedpersoncode;
    }

    public void setPledgedpersoncode(Tcustperson pledgedpersoncode) {
        this.pledgedpersoncode = pledgedpersoncode;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail1() {
        return tgenecatalogdetail1;
    }

    public void setTgenecatalogdetail1(Tgenecatalogdetail tgenecatalogdetail1) {
        this.tgenecatalogdetail1 = tgenecatalogdetail1;
    }

    public Tgenecurrency getCurrencycode() {
        return currencycode;
    }

    public void setCurrencycode(Tgenecurrency currencycode) {
        this.currencycode = currencycode;
    }

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

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