public abstract class MongoDbUtils extends Object
Mainly intended for internal use within the framework.
Modifier and Type | Method and Description |
---|---|
static void |
closeDB(DB db)
Perform actual closing of the Mongo DB object, catching and logging any cleanup exceptions thrown.
|
static DB |
getDB(Mongo mongo,
String databaseName)
|
static DB |
getDB(Mongo mongo,
String databaseName,
org.springframework.data.authentication.UserCredentials credentials)
|
static boolean |
isDBTransactional(DB db,
Mongo mongo)
Return whether the given DB instance is transactional, that is, bound to the current thread by Spring's transaction
facilities.
|
public static DB getDB(Mongo mongo, String databaseName, org.springframework.data.authentication.UserCredentials credentials)
public static boolean isDBTransactional(DB db, Mongo mongo)
db
- the DB to checkmongo
- the Mongo instance that the DB was created with (may be null
)public static void closeDB(DB db)
db
- the DB to close (may be null
)Copyright © 2012. All Rights Reserved.