Module storm

Interface Sql


public interface Sql
Represents the generated SQL statement with parameters.
  • Method Details

    • statement

      String statement()
      The generated SQL with all parameters replaced by '?' or named ':name' placeholders.
    • statement

      Sql statement(@Nonnull String statement)
      Returns a new instance of the SQL statement with the given statement.
      Parameters:
      statement - the new SQL statement.
      Returns:
      a new instance of the SQL statement with the given statement.
    • parameters

      The parameters that were used to generate the SQL.
    • parameters

      Sql parameters(@Nonnull List<SqlTemplate.Parameter> parameters)
      Returns a new instance of the SQL statement with the given parameters.
      Parameters:
      parameters - the new parameters.
      Returns:
      a new instance of the SQL statement with the given parameters.
    • bindVariables

      A bind variables object that can be used to add bind variables to a batch, if available.
    • bindVariables

      Sql bindVariables(@Nullable SqlTemplate.BindVariables bindVariables)
      Returns a new instance of the SQL statement with the given bind variables.
      Parameters:
      bindVariables - the new bind variables
      Returns:
      a new instance of the SQL statement with the given bind variables
    • generatedKeys

      List<String> generatedKeys()
      The primary key that have been auto generated as part of in insert statement.

      Note that the generated keys are only set when the SQL is generated using an Elements.Insert element, either directly or indirectly using Elements.Table.

    • generatedKeys

      Sql generatedKeys(@Nonnull List<String> generatedKeys)
      Returns a new instance of the SQL statement with the given generated keys.
      Parameters:
      generatedKeys - the new generated keys
      Returns:
      a new instance of the SQL statement with the given generated keys
      Since:
      1.2
    • versionAware

      boolean versionAware()
      Returns true if the statement is version aware, false otherwise.

      Note that the version aware flag is only set when the SQL is generated using a Elements.Set element.

    • versionAware

      Sql versionAware(boolean versionAware)
      Returns a new instance of the SQL statement with the version aware flag set to the given value.
      Parameters:
      versionAware - the new value of the version aware flag.
      Returns:
      a new instance of the SQL statement with the version aware flag set to the given value
      Since:
      1.2
    • unsafeWarning

      Optional<String> unsafeWarning()
      Returns a warning message if the statement is deemed potentially unsafe, an empty optional otherwise.
      Since:
      1.2
    • unsafeWarning

      Sql unsafeWarning(@Nullable String unsafeWarning)
      Returns a new instance of the SQL statement with the given unsafe warning message.
      Parameters:
      unsafeWarning - the new unsafe warning message
      Returns:
      a new instance of the SQL statement with the given unsafe warning message
      Since:
      1.2