Class SQLDelete
java.lang.Object
ece.ing3.java.projet.database.sql.queries.SQLWhereQuery<SQLDelete>
ece.ing3.java.projet.database.sql.queries.SQLDelete
- All Implemented Interfaces:
SQLRequest
SQL delete helper.
Provides a convenient way to build delete SQL queries, reactive-style, for a provided model class.
- Author:
- Virgile, Nicolas, Louis-Félix
-
Constructor Details
-
SQLDelete
Creates a new helper for a model class.- Parameters:
modelClass
- Model class
-
-
Method Details
-
getModelClass
-
delete
Deletes the requested lines of a model's table from 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 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
-