public class MongoPersistentEntityIndexResolver extends Object implements IndexResolver
IndexResolver
implementation inspecting MongoPersistentEntity
for MongoPersistentEntity
to be
indexed. MongoPersistentProperty
of the MongoPersistentEntity
are inspected for potential indexes by
scanning related annotations.Modifier and Type | Class and Description |
---|---|
static class |
MongoPersistentEntityIndexResolver.CyclicPropertyReferenceException |
static class |
MongoPersistentEntityIndexResolver.IndexDefinitionHolder
Implementation of
IndexDefinition holding additional (property)path information used for creating the
index. |
Constructor and Description |
---|
MongoPersistentEntityIndexResolver(MongoMappingContext mappingContext)
Create new
MongoPersistentEntityIndexResolver . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
create, resolveIndexFor
public MongoPersistentEntityIndexResolver(MongoMappingContext mappingContext)
MongoPersistentEntityIndexResolver
.mappingContext
- must not be null.public Iterable<? extends MongoPersistentEntityIndexResolver.IndexDefinitionHolder> resolveIndexFor(TypeInformation<?> typeInformation)
IndexResolver
IndexDefinition
s for properties of given TypeInformation
. IndexDefinition
s
are created for properties and types with Indexed
, CompoundIndexes
or GeoSpatialIndexed
.resolveIndexFor
in interface IndexResolver
Iterable
in case no IndexDefinition
could be resolved for type.public List<MongoPersistentEntityIndexResolver.IndexDefinitionHolder> resolveIndexForEntity(MongoPersistentEntity<?> root)
IndexDefinition
s for given root entity by traversing MongoPersistentProperty
scanning for index annotations Indexed
, CompoundIndex
and GeospatialIndex
. The given
root has therefore to be annotated with Document
.root
- must not be null.MongoPersistentEntityIndexResolver.IndexDefinitionHolder
. Will never be null
.IllegalArgumentException
- in case of missing Document
annotation marking root entities.protected List<MongoPersistentEntityIndexResolver.IndexDefinitionHolder> createCompoundIndexDefinitions(String dotPath, String fallbackCollection, MongoPersistentEntity<?> entity)
IndexDefinition
wrapped in MongoPersistentEntityIndexResolver.IndexDefinitionHolder
for CompoundIndexes
of given type.dotPath
- The properties "dot" path representation from its document root.fallbackCollection
- type
- protected MongoPersistentEntityIndexResolver.IndexDefinitionHolder createCompoundIndexDefinition(String dotPath, String collection, CompoundIndex index, MongoPersistentEntity<?> entity)
@Nullable protected MongoPersistentEntityIndexResolver.IndexDefinitionHolder createIndexDefinition(String dotPath, String collection, MongoPersistentProperty persitentProperty)
IndexDefinition
wrapped in MongoPersistentEntityIndexResolver.IndexDefinitionHolder
out of Indexed
for given
MongoPersistentProperty
.dotPath
- The properties "dot" path representation from its document root.collection
- persitentProperty
- @Nullable protected MongoPersistentEntityIndexResolver.IndexDefinitionHolder createGeoSpatialIndexDefinition(String dotPath, String collection, MongoPersistentProperty persistentProperty)
IndexDefinition
wrapped in MongoPersistentEntityIndexResolver.IndexDefinitionHolder
out of GeoSpatialIndexed
for
MongoPersistentProperty
.dotPath
- The properties "dot" path representation from its document root.collection
- persistentProperty
- Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.