1
1
/*
2
- * Copyright 2014-2015 the original author or authors.
2
+ * Copyright 2014-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.
53
53
* indexed. <br />
54
54
* All {@link MongoPersistentProperty} of the {@link MongoPersistentEntity} are inspected for potential indexes by
55
55
* scanning related annotations.
56
- *
56
+ *
57
57
* @author Christoph Strobl
58
58
* @author Thomas Darimont
59
+ * @author Martin Macko
59
60
* @since 1.5
60
61
*/
61
62
public class MongoPersistentEntityIndexResolver implements IndexResolver {
@@ -66,7 +67,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
66
67
67
68
/**
68
69
* Create new {@link MongoPersistentEntityIndexResolver}.
69
- *
70
+ *
70
71
* @param mappingContext must not be {@literal null}.
71
72
*/
72
73
public MongoPersistentEntityIndexResolver (MongoMappingContext mappingContext ) {
@@ -87,7 +88,7 @@ public Iterable<? extends IndexDefinitionHolder> resolveIndexFor(TypeInformation
87
88
* Resolve the {@link IndexDefinition}s for given {@literal root} entity by traversing {@link MongoPersistentProperty}
88
89
* scanning for index annotations {@link Indexed}, {@link CompoundIndex} and {@link GeospatialIndex}. The given
89
90
* {@literal root} has therefore to be annotated with {@link Document}.
90
- *
91
+ *
91
92
* @param root must not be null.
92
93
* @return List of {@link IndexDefinitionHolder}. Will never be {@code null}.
93
94
* @throws IllegalArgumentException in case of missing {@link Document} annotation marking root entities.
@@ -133,7 +134,7 @@ public void doWithPersistentProperty(MongoPersistentProperty persistentProperty)
133
134
134
135
/**
135
136
* Recursively resolve and inspect properties of given {@literal type} for indexes to be created.
136
- *
137
+ *
137
138
* @param type
138
139
* @param path The {@literal "dot} path.
139
140
* @param collection
@@ -281,7 +282,7 @@ public void doWithPersistentProperty(MongoPersistentProperty persistentProperty)
281
282
282
283
/**
283
284
* Create {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} for {@link CompoundIndexes} of given type.
284
- *
285
+ *
285
286
* @param dotPath The properties {@literal "dot"} path representation from its document root.
286
287
* @param fallbackCollection
287
288
* @param type
@@ -361,7 +362,7 @@ private DBObject resolveCompoundIndexKeyFromStringDefinition(String dotPath, Str
361
362
/**
362
363
* Creates {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} out of {@link Indexed} for given
363
364
* {@link MongoPersistentProperty}.
364
- *
365
+ *
365
366
* @param dotPath The properties {@literal "dot"} path representation from its document root.
366
367
* @param collection
367
368
* @param persitentProperty
@@ -402,7 +403,7 @@ protected IndexDefinitionHolder createIndexDefinition(String dotPath, String fal
402
403
/**
403
404
* Creates {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} out of {@link GeoSpatialIndexed} for
404
405
* {@link MongoPersistentProperty}.
405
- *
406
+ *
406
407
* @param dotPath The properties {@literal "dot"} path representation from its document root.
407
408
* @param collection
408
409
* @param persistentProperty
@@ -479,7 +480,7 @@ public void doWithAssociation(Association<MongoPersistentProperty> association)
479
480
/**
480
481
* {@link CycleGuard} holds information about properties and the paths for accessing those. This information is used
481
482
* to detect potential cycles within the references.
482
- *
483
+ *
483
484
* @author Christoph Strobl
484
485
*/
485
486
static class CycleGuard {
@@ -529,24 +530,24 @@ private String createMapKey(MongoPersistentProperty property) {
529
530
/**
530
531
* Path defines the property and its full path from the document root. <br />
531
532
* A {@link Path} with {@literal spring.data.mongodb} would be created for the property {@code Three.mongodb}.
532
- *
533
+ *
533
534
* <pre>
534
535
* <code>
535
536
* @Document
536
537
* class One {
537
538
* Two spring;
538
539
* }
539
- *
540
+ *
540
541
* class Two {
541
542
* Three data;
542
543
* }
543
- *
544
+ *
544
545
* class Three {
545
546
* String mongodb;
546
547
* }
547
548
* </code>
548
549
* </pre>
549
- *
550
+ *
550
551
* @author Christoph Strobl
551
552
*/
552
553
static class Path {
@@ -569,7 +570,7 @@ public String getPath() {
569
570
* the current path. Given {@literal foo.bar.bar} cycles if {@literal foo.bar} has already been visited and
570
571
* {@code class Bar} contains a property of type {@code Bar}. The previously mentioned path would not cycle if
571
572
* {@code class Bar} contained a property of type {@code SomeEntity} named {@literal bar}.
572
- *
573
+ *
573
574
* @param property
574
575
* @param path
575
576
* @return
@@ -618,7 +619,7 @@ public String getMessage() {
618
619
/**
619
620
* Implementation of {@link IndexDefinition} holding additional (property)path information used for creating the
620
621
* index. The path itself is the properties {@literal "dot"} path representation from its root document.
621
- *
622
+ *
622
623
* @author Christoph Strobl
623
624
* @since 1.5
624
625
*/
@@ -630,7 +631,7 @@ public static class IndexDefinitionHolder implements IndexDefinition {
630
631
631
632
/**
632
633
* Create
633
- *
634
+ *
634
635
* @param path
635
636
*/
636
637
public IndexDefinitionHolder (String path , IndexDefinition definition , String collection ) {
@@ -646,7 +647,7 @@ public String getCollection() {
646
647
647
648
/**
648
649
* Get the {@literal "dot"} path used to create the index.
649
- *
650
+ *
650
651
* @return
651
652
*/
652
653
public String getPath () {
@@ -655,7 +656,7 @@ public String getPath() {
655
656
656
657
/**
657
658
* Get the {@literal raw} {@link IndexDefinition}.
658
- *
659
+ *
659
660
* @return
660
661
*/
661
662
public IndexDefinition getIndexDefinition () {
0 commit comments