Class DefaultReactiveSqlSession

    • Constructor Detail

      • DefaultReactiveSqlSession

        public DefaultReactiveSqlSession​(R2dbcMybatisConfiguration configuration,
                                         ReactiveMybatisExecutor reactiveMybatisExecutor)
        Instantiates a new Default reactive sql session.
        Parameters:
        configuration - the configuration
        reactiveMybatisExecutor - the reactive mybatis executor
    • Method Detail

      • selectOne

        public <T> reactor.core.publisher.Mono<T> selectOne​(String statement,
                                                            Object parameter)
        Description copied from interface: ReactiveSqlSession
        Retrieve a single row mapped from the statement key and parameter.
        Specified by:
        selectOne in interface ReactiveSqlSession
        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

        public <E> reactor.core.publisher.Flux<E> selectList​(String statement,
                                                             Object parameter,
                                                             org.apache.ibatis.session.RowBounds rowBounds)
        Description copied from interface: ReactiveSqlSession
        Retrieve many mapped objects from the statement key and parameter, within the specified row bounds.
        Specified by:
        selectList in interface ReactiveSqlSession
        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

        public reactor.core.publisher.Mono<Integer> insert​(String statement,
                                                           Object parameter)
        Description copied from interface: ReactiveSqlSession
        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.
        Specified by:
        insert in interface ReactiveSqlSession
        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

        public reactor.core.publisher.Mono<Integer> update​(String statement,
                                                           Object parameter)
        Description copied from interface: ReactiveSqlSession
        Execute an update statement. The number of rows affected will be returned.
        Specified by:
        update in interface ReactiveSqlSession
        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

        public reactor.core.publisher.Mono<Integer> delete​(String statement,
                                                           Object parameter)
        Description copied from interface: ReactiveSqlSession
        Execute a delete statement. The number of rows affected will be returned.
        Specified by:
        delete in interface ReactiveSqlSession
        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

        public reactor.core.publisher.Mono<Void> commit​(boolean force)
        Description copied from interface: ReactiveSqlSession
        Perform commits database connection.
        Specified by:
        commit in interface ReactiveSqlSession
        Parameters:
        force - forces connection commit
        Returns:
        mono
      • rollback

        public reactor.core.publisher.Mono<Void> rollback​(boolean force)
        Description copied from interface: ReactiveSqlSession
        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.
        Specified by:
        rollback in interface ReactiveSqlSession
        Parameters:
        force - forces connection rollback
        Returns:
        mono
      • getMapper

        public <T> T getMapper​(Class<T> type)
        Description copied from interface: ReactiveSqlSession
        Retrieves a mapper.
        Specified by:
        getMapper in interface ReactiveSqlSession
        Type Parameters:
        T - the mapper type
        Parameters:
        type - Mapper interface class
        Returns:
        a mapper bound to this SqlSession