Class MongoDbClient

java.lang.Object
io.helidon.dbclient.DbClientBase
io.helidon.dbclient.mongodb.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
      Returns:
      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
      Returns:
      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
      Returns:
      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
      Parameters:
      cls - target class to be unwrapped
      Returns:
      database client internals matching provided class.