/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mx.edu.um.mateo.colportor.model;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
/**
*
* @author osoto
*/
@Entity
@Table(name = "colegio_colportor")
public class ColegioColportor implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Version
private Integer version;
@NotNull
@Column(unique = true, nullable = false, length = 64)
private String nombre;
@NotNull
@Column(nullable = false, length = 2, name = "status")
private String status;
public ColegioColportor() {
}
public ColegioColportor(String nombre, String status){
this.nombre = nombre;
this.status = status;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ColegioColportor other = (ColegioColportor) obj;
if (!Objects.equals(this.nombre, other.nombre)) {
return false;
}
if (!Objects.equals(this.status, other.status)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 97 * hash + Objects.hashCode(this.nombre);
hash = 97 * hash + Objects.hashCode(this.status);
return hash;
}
@Override
public String toString() {
return "ColegioColportor{" + "nombre=" + nombre + ", status=" + status + '}';
}
}