1@Entity
2public class Book implements Identifiable<Long> {
3
4 @Id
5 @GeneratedValue
6 private Long id;
7
8 private String title;
9
10 @Override
11 public boolean equals(Object o) {
12 if (this == o) return true;
13
14 if (!(o instanceof Book))
15 return false;
16
17 Book other = (Book) o;
18
19 return id != null &&
20 id.equals(other.getId());
21 }
22
23 @Override
24 public int hashCode() {
25 return getClass().hashCode();
26 }
27
28 //Getters and setters omitted for brevity
29}
30