File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 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) {
750750 boolean sortEqual = this .sort .equals (that .sort );
751751 boolean hintEqual = nullSafeEquals (this .hint , that .hint );
752752 boolean skipEqual = this .skip == that .skip ;
753- boolean limitEqual = this .limit == that .limit ;
753+ boolean limitEqual = nullSafeEquals ( this .limit , that .limit ) ;
754754 boolean metaEqual = nullSafeEquals (this .meta , that .meta );
755755 boolean collationEqual = nullSafeEquals (this .collation .orElse (null ), that .collation .orElse (null ));
756756
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ void testNorQuery() {
8989 .parse ("{ \" $nor\" : [ { \" name\" : \" Sven\" } , { \" age\" : { \" $lt\" : 50}} , { \" name\" : \" Thomas\" }]}" ));
9090 }
9191
92- @ Test
92+ @ Test // GH-4584
9393 void testQueryWithLimit () {
9494
9595 Query q = new Query (where ("name" ).gte ("M" ).lte ("T" ).and ("age" ).not ().gt (22 ));
@@ -110,6 +110,9 @@ void testQueryWithLimit() {
110110 q .limit (Limit .of (-1 ));
111111 assertThat (q .getLimit ()).isZero ();
112112 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 );
113116 }
114117
115118 @ Test
You can’t perform that action at this time.
0 commit comments