File tree 13 files changed +342
-16
lines changed
main/java/org/springframework/data/mongodb
test/java/org/springframework/data/mongodb
13 files changed +342
-16
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011-2015 the original author or authors.
2
+ * Copyright 2011-2016 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.
29
29
* @author Philipp Schneider
30
30
* @author Johno Crawford
31
31
* @author Christoph Strobl
32
+ * @author Mark Paluch
32
33
*/
33
- @ Target ({ ElementType .TYPE })
34
+ @ Target ({ ElementType .TYPE , ElementType . ANNOTATION_TYPE })
34
35
@ Documented
35
36
@ Retention (RetentionPolicy .RUNTIME )
36
37
public @interface CompoundIndex {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2010-2015 the original author or authors.
2
+ * Copyright 2010-2016 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.
27
27
* @author Laurent Canet
28
28
* @author Thomas Darimont
29
29
* @author Christoph Strobl
30
+ * @author Mark Paluch
30
31
*/
31
- @ Target (ElementType .FIELD )
32
+ @ Target ({ ElementType .FIELD , ElementType . ANNOTATION_TYPE } )
32
33
@ Retention (RetentionPolicy .RUNTIME )
33
34
public @interface GeoSpatialIndexed {
34
35
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011-2015 the original author or authors.
2
+ * Copyright 2011-2016 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.
30
30
* @author Thomas Darimont
31
31
* @author Christoph Strobl
32
32
* @author Jordi Llach
33
+ * @author Mark Paluch
33
34
*/
34
35
@ Target ({ElementType .ANNOTATION_TYPE , ElementType .FIELD })
35
36
@ Retention (RetentionPolicy .RUNTIME )
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014 the original author or authors.
2
+ * Copyright 2014-2016 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.
26
26
* all fields marked with {@link TextIndexed} are combined into one single index. <br />
27
27
*
28
28
* @author Christoph Strobl
29
+ * @author Mark Paluch
29
30
* @since 1.6
30
31
*/
31
32
@ Documented
32
- @ Target ({ ElementType .FIELD })
33
+ @ Target ({ ElementType .FIELD , ElementType . ANNOTATION_TYPE })
33
34
@ Retention (RetentionPolicy .RUNTIME )
34
35
public @interface TextIndexed {
35
36
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2011-2015 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
package org .springframework .data .mongodb .core .mapping ;
2
17
3
18
import java .lang .annotation .Documented ;
8
23
* Annotation to define custom metadata for document fields.
9
24
*
10
25
* @author Oliver Gierke
26
+ * @author Mark Paluch
11
27
*/
12
28
@ Documented
13
29
@ Retention (RetentionPolicy .RUNTIME )
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014 the original author or authors.
2
+ * Copyright 2014-2016 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.
25
25
26
26
/**
27
27
* @author Christoph Strobl
28
+ * @author Mark Paluch
28
29
* @since 1.6
29
30
*/
30
31
@ Retention (RetentionPolicy .RUNTIME )
31
- @ Target (ElementType .METHOD )
32
+ @ Target ({ ElementType .METHOD , ElementType . ANNOTATION_TYPE } )
32
33
@ Documented
33
34
@ QueryAnnotation
34
35
public @interface Meta {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011-2014 the original author or authors.
2
+ * Copyright 2011-2016 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.
30
30
* @author Oliver Gierke
31
31
* @author Thomas Darimont
32
32
* @author Christoph Strobl
33
+ * @author Mark Paluch
33
34
*/
34
35
@ Retention (RetentionPolicy .RUNTIME )
35
- @ Target (ElementType .METHOD )
36
+ @ Target ({ ElementType .METHOD , ElementType . ANNOTATION_TYPE } )
36
37
@ Documented
37
38
@ QueryAnnotation
38
39
public @interface Query {
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011-2015 the original author or authors.
2
+ * Copyright 2011-2016 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.
20
20
import java .util .Arrays ;
21
21
import java .util .List ;
22
22
23
+ import org .springframework .core .annotation .AnnotatedElementUtils ;
23
24
import org .springframework .core .annotation .AnnotationUtils ;
24
25
import org .springframework .data .geo .GeoPage ;
25
26
import org .springframework .data .geo .GeoResult ;
43
44
*
44
45
* @author Oliver Gierke
45
46
* @author Christoph Strobl
47
+ * @author Mark Paluch
46
48
*/
47
49
public class MongoQueryMethod extends QueryMethod {
48
50
@@ -191,7 +193,7 @@ private boolean isGeoNearQuery(Method method) {
191
193
* @return
192
194
*/
193
195
Query getQueryAnnotation () {
194
- return method . getAnnotation ( Query .class );
196
+ return AnnotatedElementUtils . findMergedAnnotation ( method , Query .class );
195
197
}
196
198
197
199
TypeInformation <?> getReturnType () {
@@ -213,7 +215,7 @@ public boolean hasQueryMetaAttributes() {
213
215
* @since 1.6
214
216
*/
215
217
Meta getMetaAnnotation () {
216
- return method . getAnnotation ( Meta .class );
218
+ return AnnotatedElementUtils . findMergedAnnotation ( method , Meta .class );
217
219
}
218
220
219
221
/**
You can’t perform that action at this time.
0 commit comments