override hashcode method for Menu.class

This commit is contained in:
jiangcaijun 2019-07-02 21:43:36 +08:00
parent 30bb595fce
commit 3296b43b48

View File

@ -119,6 +119,11 @@ public class Menu implements Serializable {
private Integer isDeleted; private Integer isDeleted;
@Override
public int hashCode() {
return (this.getId() == null) ? -1 : this.getId();
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) { if (this == obj) {
@ -134,4 +139,6 @@ public class Menu implements Serializable {
return false; return false;
} }
} }