/*
 * 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 = "alerte")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Alerte.findAll", query = "SELECT a FROM Alerte a"),
    @NamedQuery(name = "Alerte.findById", query = "SELECT a FROM Alerte a WHERE a.id = :id"),
    @NamedQuery(name = "Alerte.findByReference", query = "SELECT a FROM Alerte a WHERE a.reference = :reference"),
    @NamedQuery(name = "Alerte.findByMontant", query = "SELECT a FROM Alerte a WHERE a.montant = :montant"),
    @NamedQuery(name = "Alerte.findByDate", query = "SELECT a FROM Alerte a WHERE a.date = :date"),
    @NamedQuery(name = "Alerte.findByObservation", query = "SELECT a FROM Alerte a WHERE a.observation = :observation")})
public class Alerte implements Serializable {

    @Size(max = 50)
    @Column(name = "reference")
    private String reference;
    @Size(max = 255)
    @Column(name = "observation")
    private String observation;

    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;
    @JoinColumn(name = "fk_mouvement", referencedColumnName = "id")
    @ManyToOne
    private Mouvement fkMouvement;
    @JoinColumn(name = "fk_type_mouvement", referencedColumnName = "id")
    @ManyToOne
    private TypeMouvement fkTypeMouvement;

    public Alerte() {
    }

    public Alerte(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 Mouvement getFkMouvement() {
        return fkMouvement;
    }

    public void setFkMouvement(Mouvement fkMouvement) {
        this.fkMouvement = fkMouvement;
    }

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

    public String getReference() {
        return reference;
    }

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

    public String getObservation() {
        return observation;
    }

    public void setObservation(String observation) {
        this.observation = observation;
    }
    
}
