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

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

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "fk_user", referencedColumnName = "userid")
    @ManyToOne
    private ServiceUser fkUser;
    @JoinColumn(name = "fk_tresorie", referencedColumnName = "id")
    @ManyToOne
    private Tresorie fkTresorie;

    public ServiceUserTresorie() {
    }

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

    public Integer getId() {
        return id;
    }

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

    public ServiceUser getFkUser() {
        return fkUser;
    }

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

    public Tresorie getFkTresorie() {
        return fkTresorie;
    }

    public void setFkTresorie(Tresorie fkTresorie) {
        this.fkTresorie = fkTresorie;
    }

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