1
1
/*
2
- * Copyright 2014-2016 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.
51
51
* indexed. <br />
52
52
* All {@link MongoPersistentProperty} of the {@link MongoPersistentEntity} are inspected for potential indexes by
53
53
* scanning related annotations.
54
- *
54
+ *
55
55
* @author Christoph Strobl
56
56
* @author Thomas Darimont
57
+ * @author Martin Macko
57
58
* @since 1.5
58
59
*/
59
60
public class MongoPersistentEntityIndexResolver implements IndexResolver {
@@ -64,7 +65,7 @@ public class MongoPersistentEntityIndexResolver implements IndexResolver {
64
65
65
66
/**
66
67
* Create new {@link MongoPersistentEntityIndexResolver}.
67
- *
68
+ *
68
69
* @param mappingContext must not be {@literal null}.
69
70
*/
70
71
public MongoPersistentEntityIndexResolver (MongoMappingContext mappingContext ) {
@@ -85,7 +86,7 @@ public Iterable<? extends IndexDefinitionHolder> resolveIndexFor(TypeInformation
85
86
* Resolve the {@link IndexDefinition}s for given {@literal root} entity by traversing {@link MongoPersistentProperty}
86
87
* scanning for index annotations {@link Indexed}, {@link CompoundIndex} and {@link GeospatialIndex}. The given
87
88
* {@literal root} has therefore to be annotated with {@link Document}.
88
- *
89
+ *
89
90
* @param root must not be null.
90
91
* @return List of {@link IndexDefinitionHolder}. Will never be {@code null}.
91
92
* @throws IllegalArgumentException in case of missing {@link Document} annotation marking root entities.
@@ -131,7 +132,7 @@ public void doWithPersistentProperty(MongoPersistentProperty persistentProperty)
131
132
132
133
/**
133
134
* Recursively resolve and inspect properties of given {@literal type} for indexes to be created.
134
- *
135
+ *
135
136
* @param type
136
137
* @param path The {@literal "dot} path.
137
138
* @param collection
@@ -293,7 +294,7 @@ public void doWithPersistentProperty(MongoPersistentProperty persistentProperty)
293
294
294
295
/**
295
296
* Create {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} for {@link CompoundIndexes} of given type.
296
- *
297
+ *
297
298
* @param dotPath The properties {@literal "dot"} path representation from its document root.
298
299
* @param fallbackCollection
299
300
* @param type
@@ -372,7 +373,7 @@ private org.bson.Document resolveCompoundIndexKeyFromStringDefinition(String dot
372
373
/**
373
374
* Creates {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} out of {@link Indexed} for given
374
375
* {@link MongoPersistentProperty}.
375
- *
376
+ *
376
377
* @param dotPath The properties {@literal "dot"} path representation from its document root.
377
378
* @param collection
378
379
* @param persitentProperty
@@ -416,7 +417,7 @@ protected IndexDefinitionHolder createIndexDefinition(String dotPath, String col
416
417
/**
417
418
* Creates {@link IndexDefinition} wrapped in {@link IndexDefinitionHolder} out of {@link GeoSpatialIndexed} for
418
419
* {@link MongoPersistentProperty}.
419
- *
420
+ *
420
421
* @param dotPath The properties {@literal "dot"} path representation from its document root.
421
422
* @param collection
422
423
* @param persistentProperty
@@ -496,7 +497,7 @@ public void doWithAssociation(Association<MongoPersistentProperty> association)
496
497
/**
497
498
* {@link CycleGuard} holds information about properties and the paths for accessing those. This information is used
498
499
* to detect potential cycles within the references.
499
- *
500
+ *
500
501
* @author Christoph Strobl
501
502
*/
502
503
static class CycleGuard {
@@ -546,24 +547,24 @@ private String createMapKey(MongoPersistentProperty property) {
546
547
/**
547
548
* Path defines the property and its full path from the document root. <br />
548
549
* A {@link Path} with {@literal spring.data.mongodb} would be created for the property {@code Three.mongodb}.
549
- *
550
+ *
550
551
* <pre>
551
552
* <code>
552
553
* @Document
553
554
* class One {
554
555
* Two spring;
555
556
* }
556
- *
557
+ *
557
558
* class Two {
558
559
* Three data;
559
560
* }
560
- *
561
+ *
561
562
* class Three {
562
563
* String mongodb;
563
564
* }
564
565
* </code>
565
566
* </pre>
566
- *
567
+ *
567
568
* @author Christoph Strobl
568
569
*/
569
570
static class Path {
@@ -586,7 +587,7 @@ public String getPath() {
586
587
* the current path. Given {@literal foo.bar.bar} cycles if {@literal foo.bar} has already been visited and
587
588
* {@code class Bar} contains a property of type {@code Bar}. The previously mentioned path would not cycle if
588
589
* {@code class Bar} contained a property of type {@code SomeEntity} named {@literal bar}.
589
- *
590
+ *
590
591
* @param property
591
592
* @param path
592
593
* @return
@@ -635,7 +636,7 @@ public String getMessage() {
635
636
/**
636
637
* Implementation of {@link IndexDefinition} holding additional (property)path information used for creating the
637
638
* index. The path itself is the properties {@literal "dot"} path representation from its root document.
638
- *
639
+ *
639
640
* @author Christoph Strobl
640
641
* @since 1.5
641
642
*/
@@ -647,7 +648,7 @@ public static class IndexDefinitionHolder implements IndexDefinition {
647
648
648
649
/**
649
650
* Create
650
- *
651
+ *
651
652
* @param path
652
653
*/
653
654
public IndexDefinitionHolder (String path , IndexDefinition definition , String collection ) {
@@ -663,7 +664,7 @@ public String getCollection() {
663
664
664
665
/**
665
666
* Get the {@literal "dot"} path used to create the index.
666
- *
667
+ *
667
668
* @return
668
669
*/
669
670
public String getPath () {
@@ -672,7 +673,7 @@ public String getPath() {
672
673
673
674
/**
674
675
* Get the {@literal raw} {@link IndexDefinition}.
675
- *
676
+ *
676
677
* @return
677
678
*/
678
679
public IndexDefinition getIndexDefinition () {
0 commit comments