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

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "service_groupe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServiceGroupe.findAll", query = "SELECT s FROM ServiceGroupe s"),
    @NamedQuery(name = "ServiceGroupe.findById", query = "SELECT s FROM ServiceGroupe s WHERE s.id = :id"),
    @NamedQuery(name = "ServiceGroupe.findByNomGroupe", query = "SELECT s FROM ServiceGroupe s WHERE s.nomGroupe = :nomGroupe"),
    @NamedQuery(name = "ServiceGroupe.findByActif", query = "SELECT s FROM ServiceGroupe s WHERE s.actif = :actif")})
public class ServiceGroupe implements Serializable {

    @Size(max = 2147483647)
    @Column(name = "nom_groupe")
    private String nomGroupe;
    @Size(max = 2147483647)
    @Column(name = "actif")
    private String actif;

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "id")
    private String id;
    
     @JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
    @ManyToOne
    private Etablissement fkEtablissement;
 

    public ServiceGroupe() {
    }

    public ServiceGroupe(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

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

    public String getNomGroupe() {
        return nomGroupe;
    }

    public void setNomGroupe(String nomGroupe) {
        this.nomGroupe = nomGroupe;
    }


 

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


   

    public String getActif() {
        return actif;
    }

    public void setActif(String actif) {
        this.actif = actif;
    }

    public Etablissement getFkEtablissement() {
        return fkEtablissement;
    }

    public void setFkEtablissement(Etablissement fkEtablissement) {
        this.fkEtablissement = fkEtablissement;
    }
    
    
}
