115 lines
3.0 KiB
Java
115 lines
3.0 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.List;
|
|
import java.util.UUID;
|
|
import javax.persistence.Basic;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Lob;
|
|
import javax.persistence.NamedQueries;
|
|
import javax.persistence.NamedQuery;
|
|
import javax.persistence.OneToMany;
|
|
import javax.persistence.Table;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.Size;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
import javax.xml.bind.annotation.XmlTransient;
|
|
|
|
/**
|
|
*
|
|
* @author FORCE TECH
|
|
*/
|
|
@Entity
|
|
@Table(name = "status")
|
|
@XmlRootElement
|
|
@NamedQueries({
|
|
@NamedQuery(name = "Status.findAll", query = "SELECT s FROM Status s"),
|
|
@NamedQuery(name = "Status.findByDesignation", query = "SELECT s FROM Status s WHERE s.designation = :designation")})
|
|
public class Status implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
@Id
|
|
@Basic(optional = false)
|
|
@NotNull
|
|
@GeneratedValue
|
|
@Column(name = "id")
|
|
private UUID id;
|
|
@Basic(optional = false)
|
|
@NotNull
|
|
@Size(min = 1, max = 2147483647)
|
|
@Column(name = "designation")
|
|
private String designation;
|
|
@OneToMany(mappedBy = "fkStatus")
|
|
private List<QueueStatusTime> queueStatusTimeList;
|
|
|
|
public Status() {
|
|
}
|
|
|
|
public Status(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public Status(UUID id, String designation) {
|
|
this.id = id;
|
|
this.designation = designation;
|
|
}
|
|
|
|
public UUID getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(UUID id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getDesignation() {
|
|
return designation;
|
|
}
|
|
|
|
public void setDesignation(String designation) {
|
|
this.designation = designation;
|
|
}
|
|
|
|
@XmlTransient
|
|
public List<QueueStatusTime> getQueueStatusTimeList() {
|
|
return queueStatusTimeList;
|
|
}
|
|
|
|
public void setQueueStatusTimeList(List<QueueStatusTime> queueStatusTimeList) {
|
|
this.queueStatusTimeList = queueStatusTimeList;
|
|
}
|
|
|
|
@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 Status)) {
|
|
return false;
|
|
}
|
|
Status other = (Status) 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.Status[ id=" + id + " ]";
|
|
}
|
|
|
|
}
|