|
Spring Data MongoDB | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.index.MongoPersistentEntityIndexCreator
public class MongoPersistentEntityIndexCreator
Component that inspects MongoPersistentEntity instances contained in the given MongoMappingContext
for indexing metadata and ensures the indexes to be available.
| Constructor Summary | |
|---|---|
MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
MongoDbFactory mongoDbFactory)
Creats a new MongoPersistentEntityIndexCreator for the given MongoMappingContext and
MongoDbFactory. |
|
| Method Summary | |
|---|---|
protected void |
checkForIndexes(MongoPersistentEntity<?> entity)
|
protected void |
ensureIndex(String collection,
String name,
com.mongodb.DBObject indexDefinition,
boolean unique,
boolean dropDups,
boolean sparse)
Triggers the actual index creation. |
boolean |
isIndexCreatorFor(MappingContext<?,?> context)
Returns whether the current index creator was registered for the given MappingContext. |
void |
onApplicationEvent(MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoPersistentEntityIndexCreator(MongoMappingContext mappingContext,
MongoDbFactory mongoDbFactory)
MongoPersistentEntityIndexCreator for the given MongoMappingContext and
MongoDbFactory.
mappingContext - must not be nullmongoDbFactory - must not be null| Method Detail |
|---|
public void onApplicationEvent(MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty> event)
onApplicationEvent in interface ApplicationListener<MappingContextEvent<MongoPersistentEntity<?>,MongoPersistentProperty>>protected void checkForIndexes(MongoPersistentEntity<?> entity)
public boolean isIndexCreatorFor(MappingContext<?,?> context)
MappingContext.
context -
protected void ensureIndex(String collection,
String name,
com.mongodb.DBObject indexDefinition,
boolean unique,
boolean dropDups,
boolean sparse)
collection - the collection to create the index inname - the name of the index about to be createdindexDefinition - the index definitionunique - whether it shall be a unique indexdropDups - whether to drop duplicatessparse - sparse or not
|
Spring Data MongoDB | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||