Interface ReactiveSqlSession

  • All Known Implementing Classes:
    DefaultReactiveSqlSession

    public interface ReactiveSqlSession
    The interface Reactive sql session.
    Version:
    1.0.0
    Author:
    Gang Cheng
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      reactor.core.publisher.Mono<Void> close()
      close session
      default reactor.core.publisher.Mono<Void> commit()
      Perform commits database connection.
      reactor.core.publisher.Mono<Void> commit​(boolean force)
      Perform commits database connection.
      default reactor.core.publisher.Mono<Integer> delete​(String statement)
      Execute a delete statement.
      reactor.core.publisher.Mono<Integer> delete​(String statement, Object parameter)
      Execute a delete statement.
      R2dbcMybatisConfiguration getConfiguration()
      Retrieves current configuration.
      <T> T getMapper​(Class<T> type)
      Retrieves a mapper.
      default reactor.core.publisher.Mono<Integer> insert​(String statement)
      Execute an insert statement.
      reactor.core.publisher.Mono<Integer> insert​(String statement, Object parameter)
      Execute an insert statement with the given parameter object.
      default reactor.core.publisher.Mono<Void> rollback()
      Perform rollback database connection .
      reactor.core.publisher.Mono<Void> rollback​(boolean force)
      Discards pending batch statements and rolls database connection back.
      default <E> reactor.core.publisher.Flux<E> selectList​(String statement)
      Retrieve many mapped objects from the statement key.
      default <E> reactor.core.publisher.Flux<E> selectList​(String statement, Object parameter)
      Retrieve many mapped objects from the statement key and parameter.
      <E> reactor.core.publisher.Flux<E> selectList​(String statement, Object parameter, org.apache.ibatis.session.RowBounds rowBounds)
      Retrieve many mapped objects from the statement key and parameter, within the specified row bounds.
      default <T> reactor.core.publisher.Mono<T> selectOne​(String statement)
      Retrieve a single row mapped from the statement key.
      <T> reactor.core.publisher.Mono<T> selectOne​(String statement, Object parameter)
      Retrieve a single row mapped from the statement key and parameter.
      ReactiveSqlSession setAutoCommit​(boolean autoCommit)
      set auto commit
      ReactiveSqlSession setIsolationLevel​(io.r2dbc.spi.IsolationLevel isolationLevel)
      set isolation level
      default reactor.core.publisher.Mono<Integer> update​(String statement)
      Execute an update statement.
      reactor.core.publisher.Mono<Integer> update​(String statement, Object parameter)
      Execute an update statement.
      ReactiveSqlSession usingTransaction​(boolean usingTransactionSupport)
      set transaction or not
    • Method Detail

      • setAutoCommit

        ReactiveSqlSession setAutoCommit​(boolean autoCommit)
        set auto commit
        Parameters:
        autoCommit - the auto commit
        Returns:
        current ReactiveSqlSession
      • setIsolationLevel

        ReactiveSqlSession setIsolationLevel​(io.r2dbc.spi.IsolationLevel isolationLevel)
        set isolation level
        Parameters:
        isolationLevel - the isolation level
        Returns:
        current ReactiveSqlSession
      • usingTransaction

        ReactiveSqlSession usingTransaction​(boolean usingTransactionSupport)
        set transaction or not
        Parameters:
        usingTransactionSupport - the using transaction support
        Returns:
        current ReactiveSqlSession
      • selectOne

        default <T> reactor.core.publisher.Mono<T> selectOne​(String statement)
        Retrieve a single row mapped from the statement key.
        Type Parameters:
        T - the returned object type
        Parameters:
        statement - the statement
        Returns:
        Mapped object
      • selectOne

        <T> reactor.core.publisher.Mono<T> selectOne​(String statement,
                                                     Object parameter)
        Retrieve a single row mapped from the statement key and parameter.
        Type Parameters:
        T - the returned object type
        Parameters:
        statement - Unique identifier matching the statement to use.
        parameter - A parameter object to pass to the statement.
        Returns:
        Mapped object
      • selectList

        default <E> reactor.core.publisher.Flux<E> selectList​(String statement)
        Retrieve many mapped objects from the statement key.
        Type Parameters:
        E - the returned list element type
        Parameters:
        statement - Unique identifier matching the statement to use.
        Returns:
        List of mapped object
      • selectList

        default <E> reactor.core.publisher.Flux<E> selectList​(String statement,
                                                              Object parameter)
        Retrieve many mapped objects from the statement key and parameter.
        Type Parameters:
        E - the returned list element type
        Parameters:
        statement - Unique identifier matching the statement to use.
        parameter - A parameter object to pass to the statement.
        Returns:
        List of mapped object
      • selectList

        <E> reactor.core.publisher.Flux<E> selectList​(String statement,
                                                      Object parameter,
                                                      org.apache.ibatis.session.RowBounds rowBounds)
        Retrieve many mapped objects from the statement key and parameter, within the specified row bounds.
        Type Parameters:
        E - the returned list element type
        Parameters:
        statement - Unique identifier matching the statement to use.
        parameter - A parameter object to pass to the statement.
        rowBounds - Bounds to limit object retrieval
        Returns:
        List of mapped object
      • insert

        default reactor.core.publisher.Mono<Integer> insert​(String statement)
        Execute an insert statement.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        Returns:
        int The number of rows affected by the insert.
      • insert

        reactor.core.publisher.Mono<Integer> insert​(String statement,
                                                    Object parameter)
        Execute an insert statement with the given parameter object. Any generated autoincrement values or selectKey entries will modify the given parameter object properties. Only the number of rows affected will be returned.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        parameter - A parameter object to pass to the statement.
        Returns:
        int The number of rows affected by the insert.
      • update

        default reactor.core.publisher.Mono<Integer> update​(String statement)
        Execute an update statement. The number of rows affected will be returned.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        Returns:
        int The number of rows affected by the update.
      • update

        reactor.core.publisher.Mono<Integer> update​(String statement,
                                                    Object parameter)
        Execute an update statement. The number of rows affected will be returned.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        parameter - A parameter object to pass to the statement.
        Returns:
        int The number of rows affected by the update.
      • delete

        default reactor.core.publisher.Mono<Integer> delete​(String statement)
        Execute a delete statement. The number of rows affected will be returned.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        Returns:
        int The number of rows affected by the delete.
      • delete

        reactor.core.publisher.Mono<Integer> delete​(String statement,
                                                    Object parameter)
        Execute a delete statement. The number of rows affected will be returned.
        Parameters:
        statement - Unique identifier matching the statement to execute.
        parameter - A parameter object to pass to the statement.
        Returns:
        int The number of rows affected by the delete.
      • commit

        default reactor.core.publisher.Mono<Void> commit()
        Perform commits database connection. Note that database connection will not be committed if no updates/deletes/inserts were called. To force the commit call commit(boolean)
        Returns:
        mono Void
      • commit

        reactor.core.publisher.Mono<Void> commit​(boolean force)
        Perform commits database connection.
        Parameters:
        force - forces connection commit
        Returns:
        mono
      • rollback

        default reactor.core.publisher.Mono<Void> rollback()
        Perform rollback database connection . Note that database connection will not be rolled back if no updates/deletes/inserts were called. To force the rollback call rollback(boolean)
        Returns:
        mono
      • rollback

        reactor.core.publisher.Mono<Void> rollback​(boolean force)
        Discards pending batch statements and rolls database connection back. Note that database connection will not be rolled back if no updates/deletes/inserts were called.
        Parameters:
        force - forces connection rollback
        Returns:
        mono
      • close

        reactor.core.publisher.Mono<Void> close()
        close session
        Returns:
        mono
      • getConfiguration

        R2dbcMybatisConfiguration getConfiguration()
        Retrieves current configuration.
        Returns:
        R2dbcMybatisConfiguration configuration
      • getMapper

        <T> T getMapper​(Class<T> type)
        Retrieves a mapper.
        Type Parameters:
        T - the mapper type
        Parameters:
        type - Mapper interface class
        Returns:
        a mapper bound to this SqlSession