package edu.lmu.cs.headmaster.ws.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; @Entity @XmlRootElement public class Major { private Long id; private String degree; private String discipline; private String collegeOrSchool; @Id @GeneratedValue(strategy = GenerationType.AUTO) @XmlAttribute public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Lob public String getDegree() { return degree; } public void setDegree(String degree) { this.degree = degree; } @Lob public String getDiscipline() { return discipline; } public void setDiscipline(String discipline) { this.discipline = discipline; } @Lob public String getCollegeOrSchool() { return collegeOrSchool; } public void setCollegeOrSchool(String collegeOrSchool) { this.collegeOrSchool = collegeOrSchool; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Major other = (Major)obj; if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } return true; } }