public interface MongoDatabaseFactory extends CodecRegistryProvider, MongoSessionProvider
MongoDatabase instances.| Modifier and Type | Method and Description | 
|---|---|
| default org.bson.codecs.configuration.CodecRegistry | getCodecRegistry()Get the underlying  CodecRegistryused by the MongoDB Java driver. | 
| PersistenceExceptionTranslator | getExceptionTranslator()Exposes a shared  MongoExceptionTranslator. | 
| com.mongodb.client.MongoDatabase | getMongoDatabase()Obtain a  MongoDatabasefrom the underlying factory. | 
| com.mongodb.client.MongoDatabase | getMongoDatabase(String dbName)Obtain a  MongoDatabaseinstance to access the database with the given name. | 
| com.mongodb.client.ClientSession | getSession(com.mongodb.ClientSessionOptions options)Obtain a  ClientSessionfor given ClientSessionOptions. | 
| default boolean | isTransactionActive()Returns if the given  MongoDatabaseFactoryis bound to aClientSessionthat has anactive transaction. | 
| MongoDatabaseFactory | withSession(com.mongodb.client.ClientSession session)Obtain a  ClientSessionbound instance ofMongoDatabaseFactoryreturningMongoDatabaseinstances that are aware and bound to the given session. | 
| default MongoDatabaseFactory | withSession(com.mongodb.ClientSessionOptions options)Obtain a  ClientSessionbound instance ofMongoDatabaseFactoryreturningMongoDatabaseinstances that are aware and bound to a new session with givenoptions. | 
getCodecFor, hasCodecForcom.mongodb.client.MongoDatabase getMongoDatabase()
                                           throws DataAccessException
MongoDatabase from the underlying factory.DataAccessExceptioncom.mongodb.client.MongoDatabase getMongoDatabase(String dbName) throws DataAccessException
MongoDatabase instance to access the database with the given name.dbName - must not be null.DataAccessExceptionPersistenceExceptionTranslator getExceptionTranslator()
MongoExceptionTranslator.default org.bson.codecs.configuration.CodecRegistry getCodecRegistry()
CodecRegistry used by the MongoDB Java driver.getCodecRegistry in interface CodecRegistryProvidercom.mongodb.client.ClientSession getSession(com.mongodb.ClientSessionOptions options)
ClientSession for given ClientSessionOptions.getSession in interface MongoSessionProvideroptions - must not be null.default MongoDatabaseFactory withSession(com.mongodb.ClientSessionOptions options)
ClientSession bound instance of MongoDatabaseFactory returning MongoDatabase
 instances that are aware and bound to a new session with given options.options - must not be null.MongoDatabaseFactory withSession(com.mongodb.client.ClientSession session)
ClientSession bound instance of MongoDatabaseFactory returning MongoDatabase
 instances that are aware and bound to the given session.session - must not be null.default boolean isTransactionActive()
MongoDatabaseFactory is bound to a ClientSession that has an
 active transaction.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.