From 3296b43b484f2e87e28faa1adfabdb0743d60cd9 Mon Sep 17 00:00:00 2001 From: jiangcaijun Date: Tue, 2 Jul 2019 21:43:36 +0800 Subject: [PATCH] override hashcode method for Menu.class --- .../src/main/java/org/springblade/system/entity/Menu.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java index 94a97bf..8ade8e6 100644 --- a/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java +++ b/blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Menu.java @@ -119,6 +119,11 @@ public class Menu implements Serializable { private Integer isDeleted; + @Override + public int hashCode() { + return (this.getId() == null) ? -1 : this.getId(); + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -134,4 +139,6 @@ public class Menu implements Serializable { return false; } + + }