/*
 * 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.List;
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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "stock_type_destinataire")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StockTypeDestinataire.findAll", query = "SELECT s FROM StockTypeDestinataire s"),
    @NamedQuery(name = "StockTypeDestinataire.findById", query = "SELECT s FROM StockTypeDestinataire s WHERE s.id = :id"),
    @NamedQuery(name = "StockTypeDestinataire.findByDesignation", query = "SELECT s FROM StockTypeDestinataire s WHERE s.designation = :designation"),
    @NamedQuery(name = "StockTypeDestinataire.findByStockTypeDestinataire", query = "SELECT s FROM StockTypeDestinataire s WHERE s.stockTypeDestinataire = :stockTypeDestinataire")})
public class StockTypeDestinataire implements Serializable {

    @Size(max = 50)
    @Column(name = "designation")
    private String designation;
    @Size(max = 50)
    @Column(name = "stock_type_destinataire")
    private String stockTypeDestinataire;

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @OneToMany(mappedBy = "fkTypeDestinataire")
    private List<Mouvement> mouvementList;

    public StockTypeDestinataire() {
    }

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

    public Integer getId() {
        return id;
    }

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


    public String getStockTypeDestinataire() {
        return stockTypeDestinataire;
    }

    public void setStockTypeDestinataire(String stockTypeDestinataire) {
        this.stockTypeDestinataire = stockTypeDestinataire;
    }

    @XmlTransient
    public List<Mouvement> getMouvementList() {
        return mouvementList;
    }

    public void setMouvementList(List<Mouvement> mouvementList) {
        this.mouvementList = mouvementList;
    }

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

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

   

   

    
    
}
