Class MongoDbClient

All Implemented Interfaces:
DbClient, AutoCloseable

public class MongoDbClient extends DbClientBase implements DbClient
MongoDB driver handler.
  • Method Details

    • execute

      public DbExecute execute()
      Description copied from interface: DbClient
      Execute database statements.
      Specified by:
      execute in interface DbClient
      database statements executor
    • transaction

      public DbTransaction transaction()
      Description copied from interface: DbClient
      Execute database statements in transaction. DbTransaction life-cycle must always be finished with DbTransaction.commit() or DbTransaction.rollback(). Those two methods mentioned above will also release database resources allocated by this transaction.
      Specified by:
      transaction in interface DbClient
      transaction to execute database statements
    • dbType

      public String dbType()
      Description copied from interface: DbClient
      Type of this database provider (such as jdbc:mysql, mongoDB etc.).
      Specified by:
      dbType in interface DbClient
      name of the database provider
    • unwrap

      public <C> C unwrap(Class<C> cls)
      Description copied from interface: DbClient
      Unwrap database client internals. Only database connection is supported.

      When java.sql.Connection is requested for JDBC provider, this connection must be closed by user code using close() method on returned Connection instance.

      Specified by:
      unwrap in interface DbClient
      Type Parameters:
      C - target class to be unwrapped
      cls - target class to be unwrapped
      database client internals matching provided class.