Package com.gengoai.sql.statement
Interface UpdateStatement
-
- All Superinterfaces:
Serializable
,SQLElement
public interface UpdateStatement extends SQLElement
SQL Statement that updates / modifies the database.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T> int
batch(@NonNull SQLContext context, @NonNull Collection<? extends T> items, @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller)
Performs a batch update over a Collection of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.default <T> int
batch(@NonNull SQLContext context, @NonNull Collection<? extends T> items, @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller, int batchSize)
Performs a batch update over a Collection of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.default int
batch(@NonNull SQLContext context, @NonNull Collection<Map<String,?>> items)
Performs a batch update over a Collection of Maps whose keys are column names and values of the column.default int
batch(@NonNull SQLContext context, @NonNull Collection<Map<String,?>> items, int batchSize)
Performs a batch update over a Collection of Maps whose keys are column names and values of the column.default <T> int
batch(@NonNull SQLContext context, @NonNull Stream<? extends T> items, @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller)
Performs a batch update over a Stream of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.default <T> int
batch(@NonNull SQLContext context, @NonNull Stream<? extends T> items, @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller, int batchSize)
Performs a batch update over a Stream of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.default int
update(@NonNull SQLContext context)
Performs the update using the givenSQLContext
default int
update(@NonNull SQLContext context, @NonNull List<Object> values)
Performs the update using the givenSQLContext
filling in indexed value placeholders using the given List of values.default int
update(@NonNull SQLContext context, @NonNull Map<String,Object> values)
Performs the update using the givenSQLContext
filling in named value placeholders using the given Map of values.default <T> int
update(@NonNull SQLContext context, T value, @NonNull CheckedBiConsumer<? super T,NamedPreparedStatement> statementFiller)
Performs the update s using the givenSQLContext
filling in value placeholders using the given value and the consumer to for filling the statement.-
Methods inherited from interface com.gengoai.sql.SQLElement
getClassName
-
-
-
-
Method Detail
-
batch
default <T> int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Stream<? extends T> items, @NonNull @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller) throws SQLException
Performs a batch update over a Stream of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.- Type Parameters:
T
- the type of object in the Stream- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statementstatementFiller
- a consumer that fills in aNamedPreparedStatement
for an item in the Stream- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
batch
default <T> int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Stream<? extends T> items, @NonNull @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller, int batchSize) throws SQLException
Performs a batch update over a Stream of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.- Type Parameters:
T
- the type of object in the Stream- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statementstatementFiller
- a consumer that fills in aNamedPreparedStatement
for an item in the StreambatchSize
- the size of the batch for updating the database- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
batch
default <T> int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Collection<? extends T> items, @NonNull @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller) throws SQLException
Performs a batch update over a Collection of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.- Type Parameters:
T
- the type of object in the Stream- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statementstatementFiller
- a consumer that fills in aNamedPreparedStatement
for an item in the Collection- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
batch
default <T> int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Collection<? extends T> items, @NonNull @NonNull CheckedBiConsumer<T,NamedPreparedStatement> statementFiller, int batchSize) throws SQLException
Performs a batch update over a Collection of items filling theNamedPreparedStatement
using the given CheckedBiConsumer.- Type Parameters:
T
- the type of object in the Stream- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statementstatementFiller
- a consumer that fills in aNamedPreparedStatement
for an item in the CollectionbatchSize
- the size of the batch for updating the database- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
batch
default int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Collection<Map<String,?>> items) throws SQLException
Performs a batch update over a Collection of Maps whose keys are column names and values of the column.- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statement- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
batch
default int batch(@NonNull @NonNull SQLContext context, @NonNull @NonNull Collection<Map<String,?>> items, int batchSize) throws SQLException
Performs a batch update over a Collection of Maps whose keys are column names and values of the column.- Parameters:
context
- the context to perform this update statement onitems
- the items to use to fill in the values of the update statementbatchSize
- the size of the batch for updating the database- Returns:
- the total number of items that were updated
- Throws:
SQLException
- something happened trying to update
-
update
default int update(@NonNull @NonNull SQLContext context) throws SQLException
Performs the update using the givenSQLContext
- Parameters:
context
- the context to perform this update statement on- Returns:
- the number of rows updated
- Throws:
SQLException
- something happened trying to update
-
update
default int update(@NonNull @NonNull SQLContext context, @NonNull @NonNull Map<String,Object> values) throws SQLException
Performs the update using the givenSQLContext
filling in named value placeholders using the given Map of values.- Parameters:
context
- the context to perform this update statement onvalues
- the values to use to fill the query statement (by Index)- Returns:
- the number of rows updated
- Throws:
SQLException
- something happened trying to update
-
update
default int update(@NonNull @NonNull SQLContext context, @NonNull @NonNull List<Object> values) throws SQLException
Performs the update using the givenSQLContext
filling in indexed value placeholders using the given List of values.- Parameters:
context
- the context to perform this update statement onvalues
- the values to use to fill the query statement (by Index)- Returns:
- the number of rows updated
- Throws:
SQLException
- something happened trying to update
-
update
default <T> int update(@NonNull @NonNull SQLContext context, @NonNull T value, @NonNull @NonNull CheckedBiConsumer<? super T,NamedPreparedStatement> statementFiller) throws SQLException
Performs the update s using the givenSQLContext
filling in value placeholders using the given value and the consumer to for filling the statement.- Type Parameters:
T
- the type parameter- Parameters:
context
- the context to perform this update statement onvalue
- the values to use for updatingstatementFiller
- the consumer to use to fill the prepared statement.- Returns:
- the number of rows updated
- Throws:
SQLException
- something happened trying to update
-
-