/*
 * 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.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "controle_tresorie")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ControleTresorie.findAll", query = "SELECT c FROM ControleTresorie c"),
    @NamedQuery(name = "ControleTresorie.findById", query = "SELECT c FROM ControleTresorie c WHERE c.id = :id"),
    @NamedQuery(name = "ControleTresorie.findByDateControle", query = "SELECT c FROM ControleTresorie c WHERE c.dateControle = :dateControle"),
    @NamedQuery(name = "ControleTresorie.findByHeure", query = "SELECT c FROM ControleTresorie c WHERE c.heure = :heure"),
    @NamedQuery(name = "ControleTresorie.findByMontant", query = "SELECT c FROM ControleTresorie c WHERE c.montant = :montant")})
public class ControleTresorie implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "date_controle")
    @Temporal(TemporalType.DATE)
    private Date dateControle;
    @Column(name = "heure")
    @Temporal(TemporalType.TIME)
    private Date heure;
    // @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;
    @JoinColumn(name = "fk_tresorie", referencedColumnName = "id")
    @ManyToOne
    private Tresorie fkTresorie;

    public ControleTresorie() {
    }

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

    public Integer getId() {
        return id;
    }

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

    public Date getDateControle() {
        return dateControle;
    }

    public void setDateControle(Date dateControle) {
        this.dateControle = dateControle;
    }

    public Date getHeure() {
        return heure;
    }

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

    public Double getMontant() {
        return montant;
    }

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

    public Tresorie getFkTresorie() {
        return fkTresorie;
    }

    public void setFkTresorie(Tresorie fkTresorie) {
        this.fkTresorie = fkTresorie;
    }

    @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 ControleTresorie)) {
            return false;
        }
        ControleTresorie other = (ControleTresorie) 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.ControleTresorie[ id=" + id + " ]";
    }
    
}
