Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Modelo.beans;
- 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 andres
- */
- @Entity
- @Table(name = "equipos")
- @XmlRootElement
- @NamedQueries({
- @NamedQuery(name = "Equipos.findAll", query = "SELECT e FROM Equipos e"),
- @NamedQuery(name = "Equipos.findById", query = "SELECT e FROM Equipos e WHERE e.id = :id"),
- @NamedQuery(name = "Equipos.findBySerial", query = "SELECT e FROM Equipos e WHERE e.serial = :serial"),
- @NamedQuery(name = "Equipos.findByMarca", query = "SELECT e FROM Equipos e WHERE e.marca = :marca"),
- @NamedQuery(name = "Equipos.findByTipo", query = "SELECT e FROM Equipos e WHERE e.tipo = :tipo")})
- public class Equipos 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 = "Serial")
- private String serial;
- @Basic(optional = false)
- @NotNull
- @Size(min = 1, max = 100)
- @Column(name = "marca")
- private String marca;
- @Basic(optional = false)
- @NotNull
- @Size(min = 1, max = 100)
- @Column(name = "tipo")
- private String tipo;
- public Equipos() {
- }
- public Equipos(Integer id) {
- this.id = id;
- }
- public Equipos(Integer id, String serial, String marca, String tipo) {
- this.id = id;
- this.serial = serial;
- this.marca = marca;
- this.tipo = tipo;
- }
- public Integer getId() {
- return id;
- }
- public void setId(Integer id) {
- this.id = id;
- }
- public String getSerial() {
- return serial;
- }
- public void setSerial(String serial) {
- this.serial = serial;
- }
- public String getMarca() {
- return marca;
- }
- public void setMarca(String marca) {
- this.marca = marca;
- }
- public String getTipo() {
- return tipo;
- }
- public void setTipo(String tipo) {
- this.tipo = tipo;
- }
- @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 Equipos)) {
- return false;
- }
- Equipos other = (Equipos) 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 "Modelo.beans.Equipos[ id=" + id + " ]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement