override hashcode method for Menu.class

This commit is contained in:
jiangcaijun 2019-07-02 21:43:36 +08:00
parent 30bb595fce
commit 3296b43b48
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}
}