157 lines
4.3 KiB
Java
157 lines
4.3 KiB
Java
/*
|
|
* 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 java.util.UUID;
|
|
import javax.persistence.Basic;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.FetchType;
|
|
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.persistence.Temporal;
|
|
import javax.persistence.TemporalType;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.Size;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
/**
|
|
*
|
|
* @author PC
|
|
*/
|
|
@Entity
|
|
@Table(name = "service_historique_connection")
|
|
@XmlRootElement
|
|
@NamedQueries({
|
|
@NamedQuery(name = "ServicehistoriqueConnection.findAll", query = "SELECT s FROM ServicehistoriqueConnection s"),
|
|
@NamedQuery(name = "ServicehistoriqueConnection.findById", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.id = :id"),
|
|
@NamedQuery(name = "ServicehistoriqueConnection.findByDate", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.date = :date"),
|
|
@NamedQuery(name = "ServicehistoriqueConnection.findByHeur", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.heur = :heur"),
|
|
@NamedQuery(name = "ServicehistoriqueConnection.findByAdresseIP", query = "SELECT s FROM ServicehistoriqueConnection s WHERE s.adresseIp = :adresseIp")})
|
|
public class ServicehistoriqueConnection implements Serializable {
|
|
|
|
@Size(max = 2147483647)
|
|
@Column(name = "adresse_ip")
|
|
private String adresseIp;
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
@Id
|
|
@NotNull
|
|
@Column(name = "id")
|
|
private UUID id;
|
|
@Column(name = "date")
|
|
@Temporal(TemporalType.DATE)
|
|
private Date date;
|
|
@Column(name = "heur")
|
|
@Temporal(TemporalType.TIME)
|
|
private Date heur;
|
|
@JoinColumn(name = "fk_user", referencedColumnName = "userid")
|
|
@ManyToOne
|
|
private ServiceUser fkUser;
|
|
@JoinColumn(name = "fk_centre", referencedColumnName = "id")
|
|
@ManyToOne
|
|
private Centre fkCentre;
|
|
@Column(name = "last_activity")
|
|
@Temporal(TemporalType.TIMESTAMP)
|
|
private Date lastActivity;
|
|
|
|
public ServicehistoriqueConnection() {
|
|
}
|
|
|
|
public ServicehistoriqueConnection(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public Date getDate() {
|
|
return date;
|
|
}
|
|
|
|
public void setDate(Date date) {
|
|
this.date = date;
|
|
}
|
|
|
|
public Date getHeur() {
|
|
return heur;
|
|
}
|
|
|
|
public void setHeur(Date heur) {
|
|
this.heur = heur;
|
|
}
|
|
|
|
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 ServicehistoriqueConnection)) {
|
|
return false;
|
|
}
|
|
ServicehistoriqueConnection other = (ServicehistoriqueConnection) 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.ServicehistoriqueConnection[ id=" + id + " ]";
|
|
}
|
|
|
|
public String getAdresseIp() {
|
|
return adresseIp;
|
|
}
|
|
|
|
public void setAdresseIp(String adresseIp) {
|
|
this.adresseIp = adresseIp;
|
|
}
|
|
|
|
public Centre getFkCentre() {
|
|
return fkCentre;
|
|
}
|
|
|
|
public void setFkCentre(Centre fkCentre) {
|
|
this.fkCentre = fkCentre;
|
|
}
|
|
|
|
public Date getLastActivity() {
|
|
return lastActivity;
|
|
}
|
|
|
|
public void setLastActivity(Date lastActivity) {
|
|
this.lastActivity = lastActivity;
|
|
}
|
|
|
|
}
|