DANIEL IVAN ESTRADA MORANDO
6 months ago
2 changed files with 149 additions and 33 deletions
@ -0,0 +1,114 @@ |
|||||
|
/* |
||||
|
* 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 mx.edu.tsj.chapala.sistemas.jin.modelo; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
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.Table; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.Size; |
||||
|
import javax.xml.bind.annotation.XmlRootElement; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @author estra |
||||
|
*/ |
||||
|
@Entity |
||||
|
@Table(name = "tokens") |
||||
|
@XmlRootElement |
||||
|
@NamedQueries({ |
||||
|
@NamedQuery(name = "Tokens.findAll", query = "SELECT t FROM Tokens t"), |
||||
|
@NamedQuery(name = "Tokens.findById", query = "SELECT t FROM Tokens t WHERE t.id = :id"), |
||||
|
@NamedQuery(name = "Tokens.findByToken", query = "SELECT t FROM Tokens t WHERE t.token = :token"), |
||||
|
@NamedQuery(name = "Tokens.findByServicio", query = "SELECT t FROM Tokens t WHERE t.servicio = :servicio")}) |
||||
|
public class Tokens implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
@Id |
||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
|
@Basic(optional = false) |
||||
|
@Column(name = "id") |
||||
|
private Integer id; |
||||
|
@Basic(optional = false) |
||||
|
@NotNull |
||||
|
@Size(min = 1, max = 100) |
||||
|
@Column(name = "token") |
||||
|
private String token; |
||||
|
@Basic(optional = false) |
||||
|
@NotNull |
||||
|
@Size(min = 1, max = 100) |
||||
|
@Column(name = "servicio") |
||||
|
private String servicio; |
||||
|
|
||||
|
public Tokens() { |
||||
|
} |
||||
|
|
||||
|
public Tokens(Integer id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Tokens(Integer id, String token, String servicio) { |
||||
|
this.id = id; |
||||
|
this.token = token; |
||||
|
this.servicio = servicio; |
||||
|
} |
||||
|
|
||||
|
public Integer getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Integer id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getToken() { |
||||
|
return token; |
||||
|
} |
||||
|
|
||||
|
public void setToken(String token) { |
||||
|
this.token = token; |
||||
|
} |
||||
|
|
||||
|
public String getServicio() { |
||||
|
return servicio; |
||||
|
} |
||||
|
|
||||
|
public void setServicio(String servicio) { |
||||
|
this.servicio = servicio; |
||||
|
} |
||||
|
|
||||
|
@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 Tokens)) { |
||||
|
return false; |
||||
|
} |
||||
|
Tokens other = (Tokens) 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 "mx.edu.tsj.chapala.sistemas.jin.modelo.Tokens[ id=" + id + " ]"; |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue