Spring Data Document

org.springframework.data.mongodb.core
Class DefaultIndexOperations

java.lang.Object
  extended by org.springframework.data.mongodb.core.DefaultIndexOperations
All Implemented Interfaces:
IndexOperations

public class DefaultIndexOperations
extends Object
implements IndexOperations

Default implementation of IndexOperations.

Author:
Mark Pollack, Oliver Gierke

Constructor Summary
DefaultIndexOperations(MongoOperations mongoOperations, String collectionName)
          Creates a new DefaultIndexOperations.
 
Method Summary
 void dropAllIndexes()
          Drops all indices from this collection.
 void dropIndex(String name)
          Drops an index from this collection.
 void ensureIndex(IndexDefinition indexDefinition)
          Ensure that an index for the provided IndexDefinition exists for the collection indicated by the entity class.
 List<IndexInfo> getIndexInfo()
          Returns the index information on the collection.
 void resetIndexCache()
          Clears all indices that have not yet been applied to this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIndexOperations

public DefaultIndexOperations(MongoOperations mongoOperations,
                              String collectionName)
Creates a new DefaultIndexOperations.

Parameters:
mongoOperations - must not be null.
collectionName - must not be null.
Method Detail

ensureIndex

public void ensureIndex(IndexDefinition indexDefinition)
Description copied from interface: IndexOperations
Ensure that an index for the provided IndexDefinition exists for the collection indicated by the entity class. If not it will be created.

Specified by:
ensureIndex in interface IndexOperations
Parameters:
indexDefinition - must not be null.

dropIndex

public void dropIndex(String name)
Description copied from interface: IndexOperations
Drops an index from this collection.

Specified by:
dropIndex in interface IndexOperations
Parameters:
name - name of index to drop

dropAllIndexes

public void dropAllIndexes()
Description copied from interface: IndexOperations
Drops all indices from this collection.

Specified by:
dropAllIndexes in interface IndexOperations

resetIndexCache

public void resetIndexCache()
Description copied from interface: IndexOperations
Clears all indices that have not yet been applied to this collection.

Specified by:
resetIndexCache in interface IndexOperations

getIndexInfo

public List<IndexInfo> getIndexInfo()
Description copied from interface: IndexOperations
Returns the index information on the collection.

Specified by:
getIndexInfo in interface IndexOperations
Returns:
index information on the collection

Spring Data Document

Copyright © 2012. All Rights Reserved.