/* * 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.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlRootElement; /** * * @author FORCE TECH */ @Entity @Table(name = "alertes_medicales") @XmlRootElement @NamedQueries({ @NamedQuery(name = "AlertesMedicales.findAll", query = "SELECT a FROM AlertesMedicales a"), @NamedQuery(name = "AlertesMedicales.findByDerscription", query = "SELECT a FROM AlertesMedicales a WHERE a.derscription = :derscription"), @NamedQuery(name = "AlertesMedicales.findByDate", query = "SELECT a FROM AlertesMedicales a WHERE a.date = :date")}) public class AlertesMedicales implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @NotNull @Lob @Column(name = "id") private Object id; @Size(max = 2147483647) @Column(name = "derscription") private String derscription; @Column(name = "date") @Temporal(TemporalType.DATE) private Date date; @JoinColumn(name = "fk_patient", referencedColumnName = "id") @ManyToOne private Patient fkPatient; @JoinColumn(name = "fk_type_alerte_medical", referencedColumnName = "id") @ManyToOne private TypeAlerteMedical fkTypeAlerteMedical; public AlertesMedicales() { } public AlertesMedicales(Object id) { this.id = id; } public Object getId() { return id; } public void setId(Object id) { this.id = id; } public String getDerscription() { return derscription; } public void setDerscription(String derscription) { this.derscription = derscription; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public Patient getFkPatient() { return fkPatient; } public void setFkPatient(Patient fkPatient) { this.fkPatient = fkPatient; } public TypeAlerteMedical getFkTypeAlerteMedical() { return fkTypeAlerteMedical; } public void setFkTypeAlerteMedical(TypeAlerteMedical fkTypeAlerteMedical) { this.fkTypeAlerteMedical = fkTypeAlerteMedical; } @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 AlertesMedicales)) { return false; } AlertesMedicales other = (AlertesMedicales) 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.AlertesMedicales[ id=" + id + " ]"; } }