Class SQLUpdate
java.lang.Object
ece.ing3.java.projet.database.sql.queries.SQLWhereQuery<SQLUpdate>
ece.ing3.java.projet.database.sql.queries.SQLUpdate
- All Implemented Interfaces:
SQLRequest
SQL update helper.
Provides a convenient way to build update SQL queries, reactive-style, for a provided model class.
- Author:
- Virgile, Nicolas, Louis-Félix
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SQLUpdate
Creates a new helper for a model class.- Parameters:
modelClass
- Model class
-
-
Method Details
-
getModelClass
-
set
Sets a new value for a defined column.- Parameters:
column
- Column to targetvalue
- New column value- Returns:
- This SQL insert helper
- Throws:
NullPointerException
- Column or value isnull
-
update
Updates the database according to the provided values and conditions.- Returns:
- Either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing
- Throws:
IllegalArgumentException
- No values where setDatabaseException
- Database error
-
toString
Generate the SQL query for this insert helper.- Specified by:
toString
in interfaceSQLRequest
- Overrides:
toString
in classObject
- Returns:
- Generated SQL query
- Throws:
IllegalArgumentException
- No values where added
-
getParameters
Description copied from interface:SQLRequest
Gets all the request's parameters- Specified by:
getParameters
in interfaceSQLRequest
- Overrides:
getParameters
in classSQLWhereQuery<SQLUpdate>
- Returns:
- Request parameters
-