/*
 * 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.Collection;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
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 Asma
 */
@Entity
@Table(name = "service_user")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServiceUser.findAll", query = "SELECT s FROM ServiceUser s"),
    @NamedQuery(name = "ServiceUser.findByUserid", query = "SELECT s FROM ServiceUser s WHERE s.userid = :userid"),
    @NamedQuery(name = "ServiceUser.findByUserpw", query = "SELECT s FROM ServiceUser s WHERE s.userpw = :userpw"),
    @NamedQuery(name = "ServiceUser.findByNom", query = "SELECT s FROM ServiceUser s WHERE s.nom = :nom"),
    @NamedQuery(name = "ServiceUser.findByPrenom", query = "SELECT s FROM ServiceUser s WHERE s.prenom = :prenom"),
    @NamedQuery(name = "ServiceUser.findByTelephone", query = "SELECT s FROM ServiceUser s WHERE s.telephone = :telephone"),
    @NamedQuery(name = "ServiceUser.findByMail", query = "SELECT s FROM ServiceUser s WHERE s.mail = :mail"),
    @NamedQuery(name = "ServiceUser.findByActif", query = "SELECT s FROM ServiceUser s WHERE s.actif = :actif")})
public class ServiceUser implements Serializable {

    @Size(max = 2147483647)
    @Column(name = "userpw")
    private String userpw;
    @Size(max = 2147483647)
    @Column(name = "nom")
    private String nom;
    
    @Size(max = 2147483647)
    @Column(name = "prenom")
    private String prenom;
    @Size(max = 50)
    @Column(name = "telephone")
    private String telephone;
    @Size(max = 2147483647)
    @Column(name = "mail")
    private String mail;
    @Size(max = 2147483647)
    @Column(name = "actif")
    private String actif;
    @Size(max = 5)
    @Column(name = "forcermap")
    private String forcermap;
    @OneToMany(mappedBy = "fkManipulateur")
    private List<ServiceHistoriqueManipulation> serviceHistoriqueManipulationList;
   
    @OneToMany(mappedBy = "fkUser")
    private List<ServiceMember> serviceMemberList;
    @OneToMany(mappedBy = "fkUser")
    private List<Mouvement> mouvementList;
    @OneToMany(mappedBy = "fkUser")
    private List<ServiceUserTresorie> serviceUserTresorieList;
    @OneToMany(mappedBy = "fkUser")
    private List<ServiceEtablissementUser> serviceEtablissementUserList;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "userid")
    private String userid;
    @OneToMany(mappedBy = "fkUser")
    private List<ServicehistoriqueConnection> servicehistoriqueConnectionList;
   

    public ServiceUser() {
    }

    public ServiceUser(String userid) {
        this.userid = userid;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

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

    @Override
    public String toString() {
        return "com.triz.trizservice.modeles.ServiceUser[ userid=" + userid + " ]";
    }
    @XmlTransient
    public List<ServiceMember> getServiceMemberList() {
        return serviceMemberList;
    }
    public void setServiceMemberList(List<ServiceMember> serviceMemberList) {
        this.serviceMemberList = serviceMemberList;
    }

   

    @XmlTransient
    public List<ServicehistoriqueConnection> getServicehistoriqueConnectionList() {
        return servicehistoriqueConnectionList;
    }

    public void setServicehistoriqueConnectionList(List<ServicehistoriqueConnection> servicehistoriqueConnectionList) {
        this.servicehistoriqueConnectionList = servicehistoriqueConnectionList;
    } 
    @XmlTransient
    public List<Mouvement> getMouvementList() {
        return mouvementList;
    }
    public void setMouvementList(List<Mouvement> mouvementList) {
        this.mouvementList = mouvementList;
    }
    @XmlTransient
    public List<ServiceUserTresorie> getServiceUserTresorieList() {
        return serviceUserTresorieList;
    }
    public void setServiceUserTresorieList(List<ServiceUserTresorie> serviceUserTresorieList) {
        this.serviceUserTresorieList = serviceUserTresorieList;
    }
    @XmlTransient
    public List<ServiceEtablissementUser> getServiceEtablissementUserList() {
        return serviceEtablissementUserList;
    }
    public void setServiceEtablissementUserList(List<ServiceEtablissementUser> serviceEtablissementUserList) {
        this.serviceEtablissementUserList = serviceEtablissementUserList;
    }


   

    @XmlTransient
    public List<ServiceHistoriqueManipulation> getServiceHistoriqueManipulationList() {
        return serviceHistoriqueManipulationList;
    }

    public void setServiceHistoriqueManipulationList(List<ServiceHistoriqueManipulation> serviceHistoriqueManipulationList) {
        this.serviceHistoriqueManipulationList = serviceHistoriqueManipulationList;
    }

    public String getUserpw() {
        return userpw;
    }

    public void setUserpw(String userpw) {
        this.userpw = userpw;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getActif() {
        return actif;
    }

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

    public String getForcermap() {
        return forcermap;
    }

    public void setForcermap(String forcermap) {
        this.forcermap = forcermap;
    }

  

    
}
