@Override public void removeAll(String collectionName) { LOG.debug("Remove all documents from [{}] collection.", collectionName); mongoTemplate.dropCollection(collectionName); }
public static MongoDbFactory prepareMongoFactory(String... additionalCollectionToDrop) throws Exception{ MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test"); MongoTemplate template = new MongoTemplate(mongoDbFactory); template.dropCollection("messages"); template.dropCollection("data"); for (String additionalCollection : additionalCollectionToDrop) { template.dropCollection(additionalCollection); } return mongoDbFactory; } }
public <T> void dropCollection(Class<T> entityClass) { dropCollection(operations.determineCollectionName(entityClass)); }
public void removeAll() { LOG.debug("Remove all documents from [{}] collection.", getCollectionName()); mongoTemplate.dropCollection(getDocumentClass()); }
public <T> void dropCollection(Class<T> entityClass) { dropCollection(operations.determineCollectionName(entityClass)); }
protected void cleanupCollections(MongoDbFactory mongoDbFactory, String... additionalCollectionsToDrop) { MongoTemplate template = new MongoTemplate(mongoDbFactory); template.dropCollection("messages"); template.dropCollection("configurableStoreMessages"); template.dropCollection("data"); for (String additionalCollection : additionalCollectionsToDrop) { template.dropCollection(additionalCollection); } }
@After public void cleanUp() throws Exception { MongoDbFactory mongoDbFactory = this.prepareMongoFactory(); MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory); mongoTemplate.dropCollection(COLLECTION_NAME); }
/** * Drop the given collection. * */ @Override public void deleteAllEntities() { this.mongoTemplate.dropCollection(this.entityClass); }
/** * The drops the collection. * @param collectionName the name of the database to drop. */ public void dropCollection(String collectionName) { mongoTemplate.dropCollection(collectionName); }
@Override public void dropCollection(String collectionName) { template.dropCollection(collectionName); }
@Override public void dropResources() { mongoTemplate.dropCollection(collectionName); }
@Override public void removeAllCriteria() { mongoTemplate.dropCollection(mongoCollectionName); }
/** * Drop the given collection. * */ @Override public void deleteAllEntities() { this.mongoTemplate.dropCollection(this.entityClass); }
@Override public void dropResources() { mongoTemplate.dropCollection(mongoCollectionName); }
@Override public void removeAllNotifications() { mongoTemplate.dropCollection(mongoCollectionName); }
@Override public void dropPersonCollection(String collectionName) { if (StringUtils.isEmpty(collectionName)) { collectionName = clz.getSimpleName(); } if (mongoTemplate.collectionExists(collectionName)) { mongoTemplate.dropCollection(collectionName); } };