com.holonplatform.datastore.jdbc.composer

## Interface SQLResult

-     public interface SQLResult

  Represents the result of a SQL operation, with methods to provide the result values.
  Since:
    5.1.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getValue(int index)` Get the value at given index.
    `default <T> T` | `getValue(SQLExecutionContext context, int index)` Get the result value at given `index` using current `SQLValueDeserializer` to obtain the value in the expected type.
    `default <T> T` | `getValue(SQLExecutionContext context, String name)` Get the result value with given `name` using current `SQLValueDeserializer` to obtain the value in the expected type.
    `default <T> T` | `getValue(SQLExecutionContext context, com.holonplatform.core.TypedExpression<T> expression, int index)` Get the result value at given `index`, using given `expression` to provide the expected value type and any other value deserialization strategy element, such as a converter, which can be used by current `SQLValueDeserializer`.
    `default <T> T` | `getValue(SQLExecutionContext context, com.holonplatform.core.TypedExpression<T> expression, String name)` Get the result value with given `name`, using given `expression` to provide the expected value type and any other value deserialization strategy element, such as a converter, which can be used by current `SQLValueDeserializer`.
    `Object` | `getValue(String name)` Get the value with given name.
    `int` | `getValueCount()` Get the number of available result values.
    `Optional<String>` | `getValueName(int index)` Get the result value name at given index, if available.

- - ### Method Detail

    - #### getValue

          Object getValue(int index)
                   throws SQLException

      Get the value at given index.
      Parameters:
        `index` - Result value index, starting from `1`.
      Returns:
        The result value
      Throws:
        `SQLException` - Error retrieving the result value

    - #### getValue

          Object getValue(String name)
                   throws SQLException

      Get the value with given name.
      Parameters:
        `name` - Resut value name (not null)
      Returns:
        The result value
      Throws:
        `SQLException` - Error retrieving the result value

    - #### getValueCount

          int getValueCount()
                     throws SQLException

      Get the number of available result values.
      Returns:
        the number of available result values
      Throws:
        `SQLException` - If an error occurred

    - #### getValueName

          Optional<String> getValueName(int index)
                                 throws SQLException

      Get the result value name at given index, if available.
      Parameters:
        `index` - Result value index, starting from `1`
      Returns:
        Optional result value name
      Throws:
        `SQLException` - If an error occurred

    - #### getValue

          default <T> T getValue(SQLExecutionContext context,
                                 com.holonplatform.core.TypedExpression<T> expression,
                                 String name)
                          throws SQLException

      Get the result value with given `name`, using given `expression` to provide the expected value type and any other value deserialization strategy element, such as a converter, which can be used by current `SQLValueDeserializer`.
      Type Parameters:
        `T` - Expected value type
      Parameters:
        `context` - SQL execution context (not null)
        `expression` - Expression (not null)
        `name` - Result value name (not null)
      Returns:
        The result value
      Throws:
        `SQLException` - If an error occurred

    - #### getValue

          default <T> T getValue(SQLExecutionContext context,
                                 com.holonplatform.core.TypedExpression<T> expression,
                                 int index)
                          throws SQLException

      Get the result value at given `index`, using given `expression` to provide the expected value type and any other value deserialization strategy element, such as a converter, which can be used by current `SQLValueDeserializer`.
      Type Parameters:
        `T` - Expected value type
      Parameters:
        `context` - SQL execution context (not null)
        `expression` - Expression (not null)
        `index` - Result value index, starting from `1`.
      Returns:
        The result value
      Throws:
        `SQLException` - If an error occurred

    - #### getValue

          default <T> T getValue(SQLExecutionContext context,
                                 String name)
                          throws SQLException

      Get the result value with given `name` using current `SQLValueDeserializer` to obtain the value in the expected type.
      Type Parameters:
        `T` - Expected value type
      Parameters:
        `context` - SQL execution context (not null)
        `name` - Result value name (not null)
      Returns:
        The result value
      Throws:
        `SQLException` - If an error occurred

    - #### getValue

          default <T> T getValue(SQLExecutionContext context,
                                 int index)
                          throws SQLException

      Get the result value at given `index` using current `SQLValueDeserializer` to obtain the value in the expected type.
      Type Parameters:
        `T` - Expected value type
      Parameters:
        `context` - SQL execution context (not null)
        `index` - Result value index, starting from `1`
      Returns:
        The result value
      Throws:
        `SQLException` - If an error occurred

Copyright © 2019 The Holon Platform. All rights reserved.