1
1
/*
2
- * Copyright 2010-2015 the original author or authors.
2
+ * Copyright 2010-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ public class Query {
58
58
59
59
/**
60
60
* Static factory method to create a {@link Query} using the provided {@link CriteriaDefinition}.
61
- *
61
+ *
62
62
* @param criteriaDefinition must not be {@literal null}.
63
63
* @return
64
64
* @since 1.6
@@ -71,7 +71,7 @@ public Query() {}
71
71
72
72
/**
73
73
* Creates a new {@link Query} using the given {@link CriteriaDefinition}.
74
- *
74
+ *
75
75
* @param criteriaDefinition must not be {@literal null}.
76
76
* @since 1.6
77
77
*/
@@ -81,7 +81,7 @@ public Query(CriteriaDefinition criteriaDefinition) {
81
81
82
82
/**
83
83
* Adds the given {@link CriteriaDefinition} to the current {@link Query}.
84
- *
84
+ *
85
85
* @param criteriaDefinition must not be {@literal null}.
86
86
* @return
87
87
* @since 1.6
@@ -96,7 +96,7 @@ public Query addCriteria(CriteriaDefinition criteriaDefinition) {
96
96
} else {
97
97
throw new InvalidMongoDbApiUsageException (
98
98
"Due to limitations of the com.mongodb.BasicDBObject, " + "you can't add a second '" + key + "' criteria. "
99
- + "Query already contains '" + existing .getCriteriaObject () + "'." );
99
+ + "Query already contains '" + serializeToJsonSafely ( existing .getCriteriaObject () ) + "'." );
100
100
}
101
101
102
102
return this ;
@@ -111,7 +111,7 @@ public Field fields() {
111
111
112
112
/**
113
113
* Set number of documents to skip before returning results.
114
- *
114
+ *
115
115
* @param skip
116
116
* @return
117
117
*/
@@ -122,7 +122,7 @@ public Query skip(int skip) {
122
122
123
123
/**
124
124
* Limit the number of returned documents to {@code limit}.
125
- *
125
+ *
126
126
* @param limit
127
127
* @return
128
128
*/
@@ -133,7 +133,7 @@ public Query limit(int limit) {
133
133
134
134
/**
135
135
* Configures the query to use the given hint when being executed.
136
- *
136
+ *
137
137
* @param name must not be {@literal null} or empty.
138
138
* @return
139
139
*/
@@ -146,7 +146,7 @@ public Query withHint(String name) {
146
146
/**
147
147
* Sets the given pagination information on the {@link Query} instance. Will transparently set {@code skip} and
148
148
* {@code limit} as well as applying the {@link Sort} instance defined with the {@link Pageable}.
149
- *
149
+ *
150
150
* @param pageable
151
151
* @return
152
152
*/
@@ -164,7 +164,7 @@ public Query with(Pageable pageable) {
164
164
165
165
/**
166
166
* Adds a {@link Sort} to the {@link Query} instance.
167
- *
167
+ *
168
168
* @param sort
169
169
* @return
170
170
*/
@@ -199,7 +199,7 @@ public Set<Class<?>> getRestrictedTypes() {
199
199
200
200
/**
201
201
* Restricts the query to only return documents instances that are exactly of the given types.
202
- *
202
+ *
203
203
* @param type may not be {@literal null}
204
204
* @param additionalTypes may not be {@literal null}
205
205
* @return
@@ -253,7 +253,7 @@ public DBObject getSortObject() {
253
253
254
254
/**
255
255
* Get the number of documents to skip.
256
- *
256
+ *
257
257
* @return
258
258
*/
259
259
public int getSkip () {
@@ -262,7 +262,7 @@ public int getSkip() {
262
262
263
263
/**
264
264
* Get the maximum number of documents to be return.
265
- *
265
+ *
266
266
* @return
267
267
*/
268
268
public int getLimit () {
@@ -388,7 +388,7 @@ public boolean equals(Object obj) {
388
388
389
389
/**
390
390
* Tests whether the settings of the given {@link Query} are equal to this query.
391
- *
391
+ *
392
392
* @param that
393
393
* @return
394
394
*/
@@ -405,7 +405,7 @@ protected boolean querySettingsEquals(Query that) {
405
405
return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual ;
406
406
}
407
407
408
- /*
408
+ /*
409
409
* (non-Javadoc)
410
410
* @see java.lang.Object#hashCode()
411
411
*/
@@ -427,7 +427,7 @@ public int hashCode() {
427
427
428
428
/**
429
429
* Returns whether the given key is the one used to hold the type restriction information.
430
- *
430
+ *
431
431
* @deprecated don't call this method as the restricted type handling will undergo some significant changes going
432
432
* forward.
433
433
* @param key
0 commit comments