Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package it.unibo.tw.hibernate;
- import java.io.Serializable;
- import java.util.Date;
- public class Student implements Serializable {
- private static final long serialVersionUID = 1L;
- // ---------------------------
- private int id;
- private String firstName;
- private String lastName;
- private Date birthDate;
- // --- constructor ----------
- public Student() {
- }
- // --- getters and setters --------------
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getFirstName() {
- return firstName;
- }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
- public String getLastName() {
- return lastName;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- public Date getBirthDate() {
- return birthDate;
- }
- public void setBirthDate(Date birthDate) {
- this.birthDate = birthDate;
- }
- // --- utilities ----------------------------
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + id;
- return result;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Student other = (Student) obj;
- if (id != other.id)
- return false;
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement