|
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.MongoDbUtils
public abstract class MongoDbUtils
Helper class featuring helper methods for internal MongoDb classes.
Mainly intended for internal use within the framework.
| Method Summary | |
|---|---|
static void |
closeDB(com.mongodb.DB db)
Perform actual closing of the Mongo DB object, catching and logging any cleanup exceptions thrown. |
static com.mongodb.DB |
getDB(com.mongodb.Mongo mongo,
String databaseName)
Obtains a DB connection for the given Mongo instance and database name |
static com.mongodb.DB |
getDB(com.mongodb.Mongo mongo,
String databaseName,
UserCredentials credentials)
Obtains a DB connection for the given Mongo instance and database name |
static boolean |
isDBTransactional(com.mongodb.DB db,
com.mongodb.Mongo mongo)
Return whether the given DB instance is transactional, that is, bound to the current thread by Spring's transaction facilities. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static com.mongodb.DB getDB(com.mongodb.Mongo mongo,
String databaseName)
DB connection for the given Mongo instance and database name
mongo - the Mongo instance, must not be null.databaseName - the database name, must not be null or empty.
DB connection
public static com.mongodb.DB getDB(com.mongodb.Mongo mongo,
String databaseName,
UserCredentials credentials)
DB connection for the given Mongo instance and database name
mongo - the Mongo instance, must not be null.databaseName - the database name, must not be null or empty.credentials - the credentials to use, must not be null.
DB connection
public static boolean isDBTransactional(com.mongodb.DB db,
com.mongodb.Mongo mongo)
db - the DB to checkmongo - the Mongo instance that the DB was created with (may be null)
public static void closeDB(com.mongodb.DB db)
db - the DB to close (may be null)
|
Spring Data MongoDB | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||