Interface QueryStatement<PS,IDX>

Type Parameters:
PS - The statement type
IDX - The index type
All Known Implementing Classes:
JdbcQueryStatement, R2dbcQueryStatement

public interface QueryStatement<PS,IDX>
An abstract interface over prepared statements.
  • Method Details

    • setValue

      QueryStatement<PS,IDX> setValue(PS statement, IDX index, Object value) throws DataAccessException
      Sets the give given object value.
      Parameters:
      statement - The statement
      index - The index
      value - The value
      Returns:
      this writer
      Throws:
      DataAccessException - if the value cannot be read
    • setDynamic

      default QueryStatement<PS,IDX> setDynamic(@NonNull PS statement, @NonNull IDX index, @NonNull @NonNull DataType dataType, Object value)
      Write a value dynamically using the result set and the given name and data type.
      Parameters:
      statement - The statement
      index - The index
      dataType - The data type
      value - the value
      Returns:
      The writer
      Throws:
      DataAccessException - if the value cannot be read
    • convertRequired

      @Nullable default <T> T convertRequired(@Nullable @Nullable Object value, Class<T> type)
      Convert the value to the given type.
      Type Parameters:
      T - The generic type
      Parameters:
      value - The value
      type - The type
      Returns:
      The converted value
      Throws:
      DataAccessException - if the value cannot be converted
    • setLong

      @NonNull default @NonNull QueryStatement<PS,IDX> setLong(PS statement, IDX name, long value)
      Write a long value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      value - The value
      Returns:
      This writer
    • setChar

      @NonNull default @NonNull QueryStatement<PS,IDX> setChar(PS statement, IDX name, char value)
      Write a char value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      value - The char value
      Returns:
      This writer
    • setDate

      @NonNull default @NonNull QueryStatement<PS,IDX> setDate(PS statement, IDX name, Date date)
      Write a date value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      date - The date
      Returns:
      This writer
    • setTimestamp

      @NonNull default @NonNull QueryStatement<PS,IDX> setTimestamp(PS statement, IDX name, Instant instant)
      Write an instant value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      instant - The instant
      Returns:
      This writer
      Since:
      3.4.2
    • setTime

      default QueryStatement<PS,IDX> setTime(PS statement, IDX name, Time instant)
      Write an instant value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      instant - The time
      Returns:
      This writer
      Since:
      3.8
    • setString

      default QueryStatement<PS,IDX> setString(PS statement, IDX name, String string)
      Write a string value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      string - The string
      Returns:
      This writer
    • setInt

      @NonNull default @NonNull QueryStatement<PS,IDX> setInt(PS statement, IDX name, int integer)
      Write an int value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      integer - The integer
      Returns:
      This writer
    • setBoolean

      @NonNull default @NonNull QueryStatement<PS,IDX> setBoolean(PS statement, IDX name, boolean bool)
      Write a boolean value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      bool - The boolean
      Returns:
      This writer
    • setFloat

      @NonNull default @NonNull QueryStatement<PS,IDX> setFloat(PS statement, IDX name, float f)
      Write a float value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      f - The float
      Returns:
      This writer
    • setByte

      @NonNull default @NonNull QueryStatement<PS,IDX> setByte(PS statement, IDX name, byte b)
      Write a byte value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      b - The byte
      Returns:
      This writer
    • setShort

      @NonNull default @NonNull QueryStatement<PS,IDX> setShort(PS statement, IDX name, short s)
      Write a short value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      s - The short
      Returns:
      This writer
    • setDouble

      @NonNull default @NonNull QueryStatement<PS,IDX> setDouble(PS statement, IDX name, double d)
      Write a double value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      d - The double
      Returns:
      This writer
    • setBigDecimal

      @NonNull default @NonNull QueryStatement<PS,IDX> setBigDecimal(PS statement, IDX name, BigDecimal bd)
      Write a BigDecimal value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      bd - The big decimal
      Returns:
      This writer
    • setBytes

      @NonNull default @NonNull QueryStatement<PS,IDX> setBytes(PS statement, IDX name, byte[] bytes)
      Write a byte[] value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      bytes - the bytes
      Returns:
      This writer
    • setArray

      @NonNull default @NonNull QueryStatement<PS,IDX> setArray(PS statement, IDX name, Object array)
      Sets an array value for the given name.
      Parameters:
      statement - The statement
      name - The name (such as the column name)
      array - the array
      Returns:
      This writer
    • getConversionService

      default io.micronaut.core.convert.ConversionService getConversionService()
      Get conversion service.
      Returns:
      the instance of ConversionService