1
1
/*
2
- * Copyright 2010-2016 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.
@@ -57,7 +57,7 @@ public class Query {
57
57
58
58
/**
59
59
* Static factory method to create a {@link Query} using the provided {@link CriteriaDefinition}.
60
- *
60
+ *
61
61
* @param criteriaDefinition must not be {@literal null}.
62
62
* @return
63
63
* @since 1.6
@@ -70,7 +70,7 @@ public Query() {}
70
70
71
71
/**
72
72
* Creates a new {@link Query} using the given {@link CriteriaDefinition}.
73
- *
73
+ *
74
74
* @param criteriaDefinition must not be {@literal null}.
75
75
* @since 1.6
76
76
*/
@@ -80,7 +80,7 @@ public Query(CriteriaDefinition criteriaDefinition) {
80
80
81
81
/**
82
82
* Adds the given {@link CriteriaDefinition} to the current {@link Query}.
83
- *
83
+ *
84
84
* @param criteriaDefinition must not be {@literal null}.
85
85
* @return
86
86
* @since 1.6
@@ -95,7 +95,7 @@ public Query addCriteria(CriteriaDefinition criteriaDefinition) {
95
95
} else {
96
96
throw new InvalidMongoDbApiUsageException (
97
97
"Due to limitations of the com.mongodb.BasicDocument, " + "you can't add a second '" + key + "' criteria. "
98
- + "Query already contains '" + existing .getCriteriaObject () + "'." );
98
+ + "Query already contains '" + serializeToJsonSafely ( existing .getCriteriaObject () ) + "'." );
99
99
}
100
100
101
101
return this ;
@@ -110,7 +110,7 @@ public Field fields() {
110
110
111
111
/**
112
112
* Set number of documents to skip before returning results.
113
- *
113
+ *
114
114
* @param skip
115
115
* @return
116
116
*/
@@ -121,7 +121,7 @@ public Query skip(int skip) {
121
121
122
122
/**
123
123
* Limit the number of returned documents to {@code limit}.
124
- *
124
+ *
125
125
* @param limit
126
126
* @return
127
127
*/
@@ -132,7 +132,7 @@ public Query limit(int limit) {
132
132
133
133
/**
134
134
* Configures the query to use the given hint when being executed.
135
- *
135
+ *
136
136
* @param name must not be {@literal null} or empty.
137
137
* @return
138
138
*/
@@ -145,7 +145,7 @@ public Query withHint(String name) {
145
145
/**
146
146
* Sets the given pagination information on the {@link Query} instance. Will transparently set {@code skip} and
147
147
* {@code limit} as well as applying the {@link Sort} instance defined with the {@link Pageable}.
148
- *
148
+ *
149
149
* @param pageable
150
150
* @return
151
151
*/
@@ -163,7 +163,7 @@ public Query with(Pageable pageable) {
163
163
164
164
/**
165
165
* Adds a {@link Sort} to the {@link Query} instance.
166
- *
166
+ *
167
167
* @param sort
168
168
* @return
169
169
*/
@@ -198,7 +198,7 @@ public Set<Class<?>> getRestrictedTypes() {
198
198
199
199
/**
200
200
* Restricts the query to only return documents instances that are exactly of the given types.
201
- *
201
+ *
202
202
* @param type may not be {@literal null}
203
203
* @param additionalTypes may not be {@literal null}
204
204
* @return
@@ -252,7 +252,7 @@ public Document getSortObject() {
252
252
253
253
/**
254
254
* Get the number of documents to skip.
255
- *
255
+ *
256
256
* @return
257
257
*/
258
258
public int getSkip () {
@@ -261,7 +261,7 @@ public int getSkip() {
261
261
262
262
/**
263
263
* Get the maximum number of documents to be return.
264
- *
264
+ *
265
265
* @return
266
266
*/
267
267
public int getLimit () {
@@ -431,7 +431,7 @@ public boolean equals(Object obj) {
431
431
432
432
/**
433
433
* Tests whether the settings of the given {@link Query} are equal to this query.
434
- *
434
+ *
435
435
* @param that
436
436
* @return
437
437
*/
@@ -448,7 +448,7 @@ protected boolean querySettingsEquals(Query that) {
448
448
return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual ;
449
449
}
450
450
451
- /*
451
+ /*
452
452
* (non-Javadoc)
453
453
* @see java.lang.Object#hashCode()
454
454
*/
@@ -470,7 +470,7 @@ public int hashCode() {
470
470
471
471
/**
472
472
* Returns whether the given key is the one used to hold the type restriction information.
473
- *
473
+ *
474
474
* @deprecated don't call this method as the restricted type handling will undergo some significant changes going
475
475
* forward.
476
476
* @param key
0 commit comments