/*
 * 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 = "type_mouvement")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TypeMouvement.findAll", query = "SELECT t FROM TypeMouvement t"),
    @NamedQuery(name = "TypeMouvement.findById", query = "SELECT t FROM TypeMouvement t WHERE t.id = :id"),
    @NamedQuery(name = "TypeMouvement.findByType", query = "SELECT t FROM TypeMouvement t WHERE t.type = :type")})
public class TypeMouvement implements Serializable {

    @Size(max = 255)
    @Column(name = "type")
    private String type;

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

    public TypeMouvement() {
    }

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

    public Integer getId() {
        return id;
    }

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


    @XmlTransient
    public List<Alerte> getAlerteList() {
        return alerteList;
    }

    public void setAlerteList(List<Alerte> alerteList) {
        this.alerteList = alerteList;
    }

    @XmlTransient
    public List<MouvementTier> getMouvementTierList() {
        return mouvementTierList;
    }

    public void setMouvementTierList(List<MouvementTier> mouvementTierList) {
        this.mouvementTierList = mouvementTierList;
    }

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

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    
}
