/*
 * 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 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.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "service_member")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ServiceMember.findAll", query = "SELECT s FROM ServiceMember s"),
    @NamedQuery(name = "ServiceMember.findById", query = "SELECT s FROM ServiceMember s WHERE s.id = :id"),
    @NamedQuery(name = "ServiceMember.findByFkGroupe", query = "SELECT s FROM ServiceMember s WHERE s.fkGroupe = :fkGroupe")})
public class ServiceMember implements Serializable {

  

  

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 50)
    @JoinColumn(name = "fk_groupe", referencedColumnName = "id")
    @ManyToOne
    private ServiceGroupe fkGroupe;
    @JoinColumn(name = "fk_user", referencedColumnName = "userid")
    @ManyToOne
    private ServiceUser fkUser;

    public ServiceMember() {
    }

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

    public Integer getId() {
        return id;
    }

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

    public ServiceGroupe getFkGroupe() {
        return fkGroupe;
    }

    public void setFkGroupe(ServiceGroupe fkGroupe) {
        this.fkGroupe = fkGroupe;
    }

    public ServiceUser getFkUser() {
        return fkUser;
    }

    public void setFkUser(ServiceUser fkUser) {
        this.fkUser = fkUser;
    }

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

   

}
