From 08d97fc99dd25ada690d3346e3918880cace3a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=82=98=EA=B2=BD=ED=98=B8?= Date: Sun, 17 Nov 2024 14:10:20 +0900 Subject: [PATCH] refactor: place refactoring --- src/main/java/org/findy/findy_be/place/domain/Place.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/findy/findy_be/place/domain/Place.java b/src/main/java/org/findy/findy_be/place/domain/Place.java index 78d75eb..517daab 100644 --- a/src/main/java/org/findy/findy_be/place/domain/Place.java +++ b/src/main/java/org/findy/findy_be/place/domain/Place.java @@ -77,12 +77,21 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; Place place = (Place)o; + + if (id != null && id.equals(place.id)) { + return true; + } + return Objects.equals(title, place.title) && Objects.equals(roadAddress, place.roadAddress); } @Override public int hashCode() { + if (id != null) { + return Objects.hash(id); + } + return Objects.hash(title, roadAddress); } }