Class SQLInsert
java.lang.Object
ece.ing3.java.projet.database.sql.queries.SQLInsert
- All Implemented Interfaces:
- SQLRequest
SQL insert helper.
 
Provides a convenient way to build insert SQL queries, reactive-style, for a provided model class.
- Author:
- Virgile, Nicolas, Louis-Félix
- 
Constructor Details- 
SQLInsertCreates a new helper for a model class.- Parameters:
- modelClass- Model class
 
 
- 
- 
Method Details- 
getModelClass- Specified by:
- getModelClassin interface- SQLRequest
 
- 
addAdd a new value to the request.- Parameters:
- column- Column to target
- value- Value to add
- Returns:
- This SQL insert helper
 
- 
insertInserts the built row in the database.- 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 added
- DatabaseException- Database error
 
- 
toStringGenerate the SQL query for this insert helper.- Specified by:
- toStringin interface- SQLRequest
- Overrides:
- toStringin class- Object
- Returns:
- Generated SQL query
- Throws:
- IllegalArgumentException- No values where added
 
- 
getParametersDescription copied from interface:SQLRequestGets all the request's parameters- Specified by:
- getParametersin interface- SQLRequest
- Returns:
- Request parameters
 
 
-