/*
 * 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.triz.trizservice.modeles;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
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.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "mouvement_tier")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MouvementTier.findAll", query = "SELECT m FROM MouvementTier m"),
    @NamedQuery(name = "MouvementTier.findById", query = "SELECT m FROM MouvementTier m WHERE m.id = :id"),
    @NamedQuery(name = "MouvementTier.findByReference", query = "SELECT m FROM MouvementTier m WHERE m.reference = :reference"),
    @NamedQuery(name = "MouvementTier.findByMontant", query = "SELECT m FROM MouvementTier m WHERE m.montant = :montant"),
    @NamedQuery(name = "MouvementTier.findByDate", query = "SELECT m FROM MouvementTier m WHERE m.date = :date"),
    @NamedQuery(name = "MouvementTier.findByCodeLetterage", query = "SELECT m FROM MouvementTier m WHERE m.codeLetterage = :codeLetterage"),
    @NamedQuery(name = "MouvementTier.findByHeure", query = "SELECT m FROM MouvementTier m WHERE m.heure = :heure")})
public class MouvementTier implements Serializable {

    @Size(max = 50)
    @Column(name = "reference")
    private String reference;
    @Size(max = 50)
    @Column(name = "code_letterage")
    private String codeLetterage;

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "montant")
    private Double montant;
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "heure")
    @Temporal(TemporalType.TIME)
    private Date heure;
    @JoinColumn(name = "fk_annee_fiscale", referencedColumnName = "annee")
    @ManyToOne
    private AnneeFiscale fkAnneeFiscale;
    @JoinColumn(name = "fk_tier", referencedColumnName = "id")
    @ManyToOne
    private Tier fkTier;
    @JoinColumn(name = "fk_type_mouvement", referencedColumnName = "id")
    @ManyToOne
    private TypeMouvement fkTypeMouvement;

    public MouvementTier() {
    }

    public MouvementTier(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    public Double getMontant() {
        return montant;
    }

    public void setMontant(Double montant) {
        this.montant = montant;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getCodeLetterage() {
        return codeLetterage;
    }

    public void setCodeLetterage(String codeLetterage) {
        this.codeLetterage = codeLetterage;
    }

    public Date getHeure() {
        return heure;
    }

    public void setHeure(Date heure) {
        this.heure = heure;
    }

    public AnneeFiscale getFkAnneeFiscale() {
        return fkAnneeFiscale;
    }

    public void setFkAnneeFiscale(AnneeFiscale fkAnneeFiscale) {
        this.fkAnneeFiscale = fkAnneeFiscale;
    }

    public Tier getFkTier() {
        return fkTier;
    }

    public void setFkTier(Tier fkTier) {
        this.fkTier = fkTier;
    }

    public TypeMouvement getFkTypeMouvement() {
        return fkTypeMouvement;
    }

    public void setFkTypeMouvement(TypeMouvement fkTypeMouvement) {
        this.fkTypeMouvement = fkTypeMouvement;
    }

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

    @Override
    public String toString() {
        return "com.triz.trizservice.modeles.MouvementTier[ id=" + id + " ]";
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

   

    
}
