Interface IResultSetRowProcessor


  • public interface IResultSetRowProcessor
    Interface used by a Result Set Row Processor. The interface should be implemented by a class that is allocated by the IResultSetProcessor and enables controlling the end of row processing as well as to be a part of the processing of each row, perhaps with a VirtualSpace table.
    Author:
    Christopher Mindus
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean doContinueRowProcessing​(ResultSetProps rsProps, int rowIndex, java.sql.ResultSet rs)
      Verifies if the row should be processed or if the processing operation should end.
      default void processRow​(RowInfo info)
      Method called for every row when the database transaction's result set is connected to a VirtualSpace table.
      default boolean processRow​(ResultSetProps rsProps, int rowIndex, java.sql.ResultSet rs)
      Method called for every row when the database transaction's result set is not connected to a VirtualSpace table.
    • Method Detail

      • doContinueRowProcessing

        default boolean doContinueRowProcessing​(ResultSetProps rsProps,
                                                int rowIndex,
                                                java.sql.ResultSet rs)
                                         throws java.sql.SQLException
        Verifies if the row should be processed or if the processing operation should end.

        Override this method to handle possible ending of operation. The default is to return true and thus all rows up to the maximum row count are processed. The maximum row count could be set to zero, i.e. unlimited, therefore all rows handled, unless this method returns false.

        This method is called once the cursor has been moved to the next row using ResultSet.next() and that method returned true indicating row presence.

        Parameters:
        rsProps - The result set properties.
        rowIndex - The row index being processed, zero for first row.
        rs - The SQL ResultSet instance.
        Returns:
        false to end row processing, or true to keep on processing (default value).
        Throws:
        java.sql.SQLException - In case of SQL exceptions.
      • processRow

        default boolean processRow​(ResultSetProps rsProps,
                                   int rowIndex,
                                   java.sql.ResultSet rs)
                            throws java.sql.SQLException
        Method called for every row when the database transaction's result set is not connected to a VirtualSpace table.

        This method is called right after calling doContinueRowProcessing(ResultSetProps, int, ResultSet) in order to have similar processing as when a VirtualSpace table is present.

        Override to process, the default implementation returns false to stop processing.

        Parameters:
        rsProps - The result set properties.
        rowIndex - The row index being processed, zero for first row.
        rs - The SQL ResultSet instance.
        Returns:
        true to keep on processing rows, or false to stop (as the default implementation does unless overridden).
        Throws:
        java.sql.SQLException - In case of SQL exceptions.
      • processRow

        default void processRow​(RowInfo info)
                         throws java.sql.SQLException
        Method called for every row when the database transaction's result set is connected to a VirtualSpace table.

        This method is called right after calling doContinueRowProcessing(ResultSetProps, int, ResultSet), but after the SQL values for the columns are retrieved and converted to the appropriate VirtualSpace Value's.

        Upon return of this method, the Value's from the RowInfo.vsValues will populate the row to overwrite or insert into the VirtualSpace table.

        Parameters:
        info - The row information holder.
        Throws:
        java.sql.SQLException - For SQL processing errors.