/**
*
*/
package name.brucephillips.springjpaexample.model;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* Models a Person.
* @author bphillips
*
*/
@Entity
@Table(name="person")
@NamedQuery(name="person.findByEmplid", query="from Person where emplid = :emplid")
public class Person implements Serializable {
private static final long serialVersionUID = 3697535594187479699L;
private Long emplid;
private String first_name;
private String last_name;
@Override
public String toString() {
return "Person [emplid=" + emplid + ", first_name=" + first_name
+ ", last_name=" + last_name + "]";
}
@Id
@GeneratedValue
public Long getEmplid() {
return emplid;
}
public void setEmplid(Long emplid) {
this.emplid = emplid;
}
public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((emplid == null) ? 0 : emplid.hashCode());
result = prime * result
+ ((first_name == null) ? 0 : first_name.hashCode());
result = prime * result
+ ((last_name == null) ? 0 : last_name.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;
}
Person other = (Person) obj;
if (emplid == null) {
if (other.emplid != null) {
return false;
}
} else if (!emplid.equals(other.emplid)) {
return false;
}
if (first_name == null) {
if (other.first_name != null) {
return false;
}
} else if (!first_name.equals(other.first_name)) {
return false;
}
if (last_name == null) {
if (other.last_name != null) {
return false;
}
} else if (!last_name.equals(other.last_name)) {
return false;
}
return true;
}
}