Added field attribute to @Query annotation.
The fields attribute allows specifying which fields of matching documents should be unmarshalled.
This commit is contained in:
@@ -83,6 +83,18 @@ class MongoQueryMethod extends QueryMethod {
|
||||
String query = (String) AnnotationUtils.getValue(getQueryAnnotation());
|
||||
return StringUtils.hasText(query) ? query : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the field specification to be used for the query.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getFieldSpecification() {
|
||||
|
||||
String value = (String) AnnotationUtils.getValue(getQueryAnnotation(), "fields");
|
||||
return StringUtils.hasText(value) ? value : null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the {@link Query} annotation that is applied to the method or {@code null} if none available.
|
||||
|
||||
@@ -33,4 +33,6 @@ import java.lang.annotation.Target;
|
||||
public @interface Query {
|
||||
|
||||
String value() default "";
|
||||
|
||||
String fields() default "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user