File tree 2 files changed +5
-2
lines changed
main/java/org/springframework/data/mongodb/core/query
test/java/org/springframework/data/mongodb/core/query
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -750,7 +750,7 @@ protected boolean querySettingsEquals(Query that) {
750
750
boolean sortEqual = this .sort .equals (that .sort );
751
751
boolean hintEqual = nullSafeEquals (this .hint , that .hint );
752
752
boolean skipEqual = this .skip == that .skip ;
753
- boolean limitEqual = this .limit == that .limit ;
753
+ boolean limitEqual = nullSafeEquals ( this .limit , that .limit ) ;
754
754
boolean metaEqual = nullSafeEquals (this .meta , that .meta );
755
755
boolean collationEqual = nullSafeEquals (this .collation .orElse (null ), that .collation .orElse (null ));
756
756
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ void testNorQuery() {
89
89
.parse ("{ \" $nor\" : [ { \" name\" : \" Sven\" } , { \" age\" : { \" $lt\" : 50}} , { \" name\" : \" Thomas\" }]}" ));
90
90
}
91
91
92
- @ Test
92
+ @ Test // GH-4584
93
93
void testQueryWithLimit () {
94
94
95
95
Query q = new Query (where ("name" ).gte ("M" ).lte ("T" ).and ("age" ).not ().gt (22 ));
@@ -110,6 +110,9 @@ void testQueryWithLimit() {
110
110
q .limit (Limit .of (-1 ));
111
111
assertThat (q .getLimit ()).isZero ();
112
112
assertThat (q .isLimited ()).isFalse ();
113
+
114
+ Query other = new Query (where ("name" ).gte ("M" )).limit (Limit .of (10 ));
115
+ assertThat (new Query (where ("name" ).gte ("M" )).limit (10 )).isEqualTo (other ).hasSameHashCodeAs (other );
113
116
}
114
117
115
118
@ Test
You can’t perform that action at this time.
0 commit comments