public class MongoPersistentEntityIndexCreator extends Object implements ApplicationListener<org.springframework.data.mapping.context.MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>
MongoPersistentEntity
instances contained in the given MongoMappingContext
for indexing metadata and ensures the indexes to be available.Constructor and Description |
---|
MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
MongoDbFactory mongoDbFactory)
Creats a new
MongoPersistentEntityIndexCreator for the given MongoMappingContext and
MongoDbFactory . |
Modifier and Type | Method and Description |
---|---|
protected void |
checkForIndexes(MongoPersistentEntity<?> entity) |
protected void |
ensureIndex(String collection,
String name,
DBObject indexDefinition,
boolean unique,
boolean dropDups,
boolean sparse) |
void |
onApplicationEvent(org.springframework.data.mapping.context.MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event) |
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, MongoDbFactory mongoDbFactory)
MongoPersistentEntityIndexCreator
for the given MongoMappingContext
and
MongoDbFactory
.mappingContext
- must not be nullmongoDbFactory
- must not be nullpublic void onApplicationEvent(org.springframework.data.mapping.context.MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event)
onApplicationEvent
in interface ApplicationListener<org.springframework.data.mapping.context.MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>
protected void checkForIndexes(MongoPersistentEntity<?> entity)
Copyright © 2012. All Rights Reserved.