From 6350e1c0d635ec76a6fe949ec01ab45c71c1b4b7 Mon Sep 17 00:00:00 2001 From: Nightblade73 Date: Thu, 2 May 2019 14:51:22 +0400 Subject: [PATCH] #70 add hashCode for deadline --- src/main/java/ru/ulstu/deadline/model/Deadline.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/ru/ulstu/deadline/model/Deadline.java b/src/main/java/ru/ulstu/deadline/model/Deadline.java index 199427c..148697c 100644 --- a/src/main/java/ru/ulstu/deadline/model/Deadline.java +++ b/src/main/java/ru/ulstu/deadline/model/Deadline.java @@ -9,6 +9,7 @@ import javax.persistence.Entity; import javax.persistence.Temporal; import javax.persistence.TemporalType; import java.util.Date; +import java.util.Objects; @Entity public class Deadline extends BaseEntity { @@ -68,4 +69,9 @@ public class Deadline extends BaseEntity { description.equals(deadline.description) && date.equals(deadline.date); } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), description, date); + } }