public class MongoPersistentEntityIndexCreator extends Object implements ApplicationListener<org.springframework.data.mapping.event.MappingContextEvent<MongoPersistentEntity<MongoPersistentProperty>,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.event.MappingContextEvent<MongoPersistentEntity<MongoPersistentProperty>,MongoPersistentProperty> event) |
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext, MongoDbFactory mongoDbFactory)
MongoPersistentEntityIndexCreator
for the given MongoMappingContext
and
MongoDbFactory
.mappingContext
- must not be mongoDbFactory
- must not be public void onApplicationEvent(org.springframework.data.mapping.event.MappingContextEvent<MongoPersistentEntity<MongoPersistentProperty>,MongoPersistentProperty> event)
onApplicationEvent
in interface ApplicationListener<org.springframework.data.mapping.event.MappingContextEvent<MongoPersistentEntity<MongoPersistentProperty>,MongoPersistentProperty>>
protected void checkForIndexes(MongoPersistentEntity<?> entity)
Copyright © 2012. All Rights Reserved.