Skip to content

Commit 5129349

Browse files
committed
remove equal() override on ebean entity model
1 parent 6273d6e commit 5129349

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

dao-impl/ebean-dao/src/main/java/com/linkedin/metadata/dao/EbeanMetadataAspect.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -88,39 +88,6 @@ public static class PrimaryKey {
8888
@Column(name = CREATED_FOR_COLUMN, nullable = true)
8989
private String createdFor;
9090

91-
@SneakyThrows
92-
@Override
93-
public boolean equals(Object o) {
94-
if (o == null) {
95-
return false;
96-
}
97-
if (o.getClass() != this.getClass()) {
98-
return false;
99-
}
100-
EbeanMetadataAspect other = (EbeanMetadataAspect) o;
101-
102-
boolean primitiveEqualityCheck = this.key.equals(other.key)
103-
// either both metadata fields are null or both are equal (will check non-null equality after)
104-
&& ((this.metadata == null && other.metadata == null) || (this.metadata != null && other.metadata != null))
105-
&& Math.abs(this.createdOn.getTime() - other.getCreatedOn().getTime()) < 1000 // timestamps are considered equal if within 1s of each other
106-
&& this.createdBy.equals(other.getCreatedBy())
107-
// either both createdFor fields are null or both are equal (need to check this.createdFor != null to avoid NPE)
108-
&& ((this.createdFor == null && other.getCreatedFor() == null) || (this.createdFor != null && this.createdFor.equals(other.getCreatedFor())));
109-
if (!primitiveEqualityCheck) {
110-
return false;
111-
}
112-
113-
JSONParser parser = new JSONParser();
114-
JSONObject thisMetadata = (JSONObject) parser.parse(this.metadata);
115-
JSONObject otherMetadata = (JSONObject) parser.parse(other.metadata);
116-
return thisMetadata.equals(otherMetadata);
117-
}
118-
119-
@Override
120-
public int hashCode() {
121-
return super.hashCode();
122-
}
123-
12491
@Override
12592
public String toString() {
12693
final String str = "EbeanMetadataAspect: {key: <urn:%s, aspect:%s, version:%s>, createdOn: %s, createdBy: %s, createdFor: %s, metadata: %s}";

0 commit comments

Comments
 (0)