package mx.edu.um.mateo.inscripciones.model; import java.util.Objects; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Version; /** * * @author semdariobarbaamaya */ @Entity @Table(name = "FES_PAQUETEALUMNO") public class AlumnoPaquete { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 7) private String matricula; @ManyToOne(optional = false) private Paquete paquete; @Column(nullable = false, length = 2) private String status; @Version private Integer version; public AlumnoPaquete(){ } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getMatricula() { return matricula; } public void setMatricula(String matricula) { this.matricula = matricula; } public Paquete getPaquete() { return paquete; } public void setPaquete(Paquete paquete) { this.paquete = paquete; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } @Override public int hashCode() { int hash = 5; hash = 97 * hash + Objects.hashCode(this.id); hash = 97 * hash + Objects.hashCode(this.matricula); hash = 97 * hash + Objects.hashCode(this.paquete); hash = 97 * hash + Objects.hashCode(this.status); hash = 97 * hash + Objects.hashCode(this.version); return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AlumnoPaquete other = (AlumnoPaquete) obj; if (!Objects.equals(this.id, other.id)) { return false; } if (!Objects.equals(this.matricula, other.matricula)) { return false; } if (!Objects.equals(this.paquete, other.paquete)) { return false; } if (!Objects.equals(this.status, other.status)) { return false; } if (!Objects.equals(this.version, other.version)) { return false; } return true; } @Override public String toString() { return "AlumnoPaquete{" + "id=" + id + ", matricula=" + matricula + ", paquete=" + paquete + ", status=" + status + ", version=" + version + '}'; } }