Interface ExecutionEngine

All Known Implementing Classes:
ExecutionEngineReturnedKeysAuto, ExecutionEngineReturnedKeysNamed

public interface ExecutionEngine
  • Method Details

    • executeInsert

      InsertResult executeInsert(PreparedSql preparedSql, ConnectionProvider connectionProvider) throws SQLException
      Execute a SQL INSERT operation using the provided prepared SQL statement and table metadata.

      This method executes the prepared statement, retrieves any generated primary key values, and wraps the results in an InsertResult object.

      Parameters:
      preparedSql - the PreparedSql object containing the SQL query string and bind values to be executed
      connectionProvider - the ConnectionProvider used to obtain a database connection.
      Returns:
      an InsertResult object encapsulating the number of affected rows and a list of generated keys (if any)
      Throws:
      SQLException - if an error occurs while executing the SQL insert or retrieving the generated keys
    • executeUpdate

      UpdateResult executeUpdate(PreparedSql preparedSql, ConnectionProvider connectionProvider) throws SQLException
      Execute a SQL UPDATE operation using the provided prepared SQL statement and table metadata.

      This method performs the execution of a prepared update statement and wraps the number of affected rows in an UpdateOpResult object.

      Parameters:
      preparedSql - the PreparedSql object containing the SQL query string and bind values to be executed
      connectionProvider - the ConnectionProvider used to obtain a database connection.
      Returns:
      an UpdateOpResult-implementing result encapsulating the number of rows affected by the update operation
      Throws:
      SQLException - if an error occurs while executing the SQL update
    • executeBatch

      BatchUpdateResult executeBatch(List<PreparedSql> preparedSqls, ConnectionProvider connectionProvider) throws SQLException
      Execute a batch of modifying SQL operations in the database using the provided statement.

      The statements must all have the same generated SQL.

      Parameters:
      preparedSqls - the list of PreparedSql statements to batch.
      connectionProvider - the ConnectionProvider used to get a database connection.
      Returns:
      an Result containing e.g. the number of rows affected and any generated keys.
      Throws:
      SQLException - if any SQL error occurs during the execution of the SELECT operation.
    • executeQuery

      List<Row> executeQuery(PreparedSql preparedSql, ConnectionProvider connectionProvider) throws SQLException
      Executes a SELECT operation in the database using a pre-prepared PreparedSql object.
      Parameters:
      preparedSql - the PreparedSql object containing the SQL query string and bind values.
      connectionProvider - the ConnectionProvider used to get a database connection.
      Returns:
      a List of Row objects representing the results of the SELECT operation.
      Throws:
      SQLException - if any SQL error occurs during the execution of the SELECT operation.
    • typeConverter

      TypeConverter typeConverter()
      Retrieve the TypeConverter instance associated with the database provider.

      The TypeConverter is used for converting objects between different types, typically for database data type conversions and mapping domain-specific representations.

      Returns:
      the TypeConverter instance for handling data type conversions