- All Known Implementing Classes:
ExecutionEngineReturnedKeysAuto,ExecutionEngineReturnedKeysNamed
public interface ExecutionEngine
-
Method Summary
Modifier and TypeMethodDescriptionexecuteBatch(List<PreparedSql> preparedSqls, ConnectionProvider connectionProvider) Execute a batch of modifying SQL operations in the database using the provided statement.executeInsert(PreparedSql preparedSql, ConnectionProvider connectionProvider) Execute a SQL INSERT operation using the provided prepared SQL statement and table metadata.executeQuery(PreparedSql preparedSql, ConnectionProvider connectionProvider) Executes a SELECT operation in the database using a pre-preparedPreparedSqlobject.executeUpdate(PreparedSql preparedSql, ConnectionProvider connectionProvider) Execute a SQL UPDATE operation using the provided prepared SQL statement and table metadata.Retrieve theTypeConverterinstance associated with the database provider.
-
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
InsertResultobject.- Parameters:
preparedSql- thePreparedSqlobject containing the SQL query string and bind values to be executedconnectionProvider- theConnectionProviderused to obtain a database connection.- Returns:
- an
InsertResultobject 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
UpdateOpResultobject.- Parameters:
preparedSql- thePreparedSqlobject containing the SQL query string and bind values to be executedconnectionProvider- theConnectionProviderused 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 ofPreparedSqlstatements to batch.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- an
Resultcontaining 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-preparedPreparedSqlobject.- Parameters:
preparedSql- thePreparedSqlobject containing the SQL query string and bind values.connectionProvider- theConnectionProviderused to get a database connection.- Returns:
- a
ListofRowobjects 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 theTypeConverterinstance associated with the database provider.The
TypeConverteris used for converting objects between different types, typically for database data type conversions and mapping domain-specific representations.- Returns:
- the
TypeConverterinstance for handling data type conversions
-