Skip to content

Commit db5357d

Browse files
committed
HHH-17002, HHH-18820, HHH-19391, HHH-18514 apply feedback from @beikov
1 parent 06e3dbf commit db5357d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/AsWrapperSqmExpression.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public BasicType<T> getNodeType() {
5656
@Override
5757
public boolean equals(Object object) {
5858
return object instanceof AsWrapperSqmExpression<?> that
59-
&& Objects.equals( this.expression, that.expression );
59+
&& Objects.equals( this.expression, that.expression )
60+
&& Objects.equals( this.getNodeType(), that.getNodeType() );
6061
}
6162

6263
@Override

hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmSelfRenderingExpression.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ public void appendHqlString(StringBuilder hql, SqmRenderContext context) {
5252
throw new UnsupportedOperationException();
5353
}
5454

55-
//TODO: what is a correct impl of equals() / hashCode() here?
55+
// No equals() / hashCode() because this stuff is only
56+
// ever used internally and is irrelevant for caching,
57+
// so basing equality on the object identity is fine
5658
}

0 commit comments

Comments
 (0)