public class MongoDBDaoSupport
extends org.springframework.dao.support.DaoSupport
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.BeanFactoryAware
| Constructor and Description |
|---|
MongoDBDaoSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkDaoConfig() |
protected void |
ensureIndexes()
Called durring the initialization phase to enable
the DAO to ensure mongo indexes.
|
com.mongodb.DBCollection |
getCollection(java.lang.String name)
Gets a
DBCollection from the DB. |
com.mongodb.DB |
getDb() |
protected MapReduceConfiguration |
getMapReduceConfiguration(java.lang.String classPath)
Loads a
MapReduceConfiguration. |
com.mongodb.Mongo |
getMongo() |
MongoDao |
getMongoDao()
Returns a
MongoDao. |
ObjectMapper |
getObjectMapper() |
protected void |
initDao() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setDb(com.mongodb.DB db) |
void |
setDbName(java.lang.String dbName) |
void |
setMongo(com.mongodb.Mongo mongo) |
void |
setMongoDao(MongoDao mongoDao) |
void |
setObjectMapper(ObjectMapper objectMapper) |
void |
setPassword(java.lang.String password) |
void |
setUsername(java.lang.String username) |
protected void checkDaoConfig()
checkDaoConfig in class org.springframework.dao.support.DaoSupportprotected void initDao()
throws java.lang.Exception
initDao in class org.springframework.dao.support.DaoSupportjava.lang.Exceptionprotected void ensureIndexes()
protected MapReduceConfiguration getMapReduceConfiguration(java.lang.String classPath)
MapReduceConfiguration.classPath - the resource nameMapReduceConfigurationpublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarepublic com.mongodb.DBCollection getCollection(java.lang.String name)
DBCollection from the DB.name - the name of the collectionpublic com.mongodb.DB getDb()
public com.mongodb.Mongo getMongo()
public void setMongo(com.mongodb.Mongo mongo)
mongo - the mongo to setpublic void setDbName(java.lang.String dbName)
DB_NAME - the DB_NAME to setpublic void setUsername(java.lang.String username)
username - the username to setpublic void setPassword(java.lang.String password)
password - the password to setpublic void setMongoDao(MongoDao mongoDao)
mongoDao - the mongoDao to setpublic void setObjectMapper(ObjectMapper objectMapper)
objectMapper - the objectMapper to setpublic void setDb(com.mongodb.DB db)
db - the db to setpublic ObjectMapper getObjectMapper()
Copyright © 2013. All Rights Reserved.