Class DeleteQueryBuilder
java.lang.Object
io.github.blyznytsiaorg.bibernate.dao.jdbc.dsl.QueryBuilder
io.github.blyznytsiaorg.bibernate.dao.jdbc.dsl.DeleteQueryBuilder
Represents a SQL DELETE query builder for constructing DELETE statements with optional WHERE conditions.
Extends the base class QueryBuilder.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
Fields inherited from class io.github.blyznytsiaorg.bibernate.dao.jdbc.dsl.QueryBuilder
ALL_FIELDS, AND, AS, BETWEEN_S_AND_S, CLOSE_BRACKET, COMA, DELETE, DOT, EQ, FROM, GROUP_BY, HAVING, IN, INSERT_INTO, OPEN_BRACKET, OR, PARAMETER, SELECT, SEMICOLON, SET, SPACE, tableName, UNDERSCORE, UNION, UPDATE, WHERE, whereConditions
-
Constructor Summary
ConstructorDescriptionDeleteQueryBuilder
(String tableName) Constructs a new DeleteQueryBuilder with the specified table name. -
Method Summary
Modifier and TypeMethodDescriptionandCondition
(String condition) Adds an AND condition to the existing WHERE conditions.betweenCondition
(String field, Object lowerBound, Object upperBound) Adds a BETWEEN condition to the existing WHERE conditions.Builds the DELETE SQL statement based on the configured conditions.static DeleteQueryBuilder
Creates a new DeleteQueryBuilder with the specified table name.orCondition
(String condition) Adds an OR condition to the existing WHERE conditions.whereCondition
(String condition) Adds a WHERE condition to the DELETE query.Methods inherited from class io.github.blyznytsiaorg.bibernate.dao.jdbc.dsl.QueryBuilder
handleWhereCondition
-
Constructor Details
-
DeleteQueryBuilder
Constructs a new DeleteQueryBuilder with the specified table name.- Parameters:
tableName
- The name of the table from which to delete records.
-
-
Method Details
-
from
Creates a new DeleteQueryBuilder with the specified table name.- Parameters:
tableName
- The name of the table from which to delete records.- Returns:
- A new instance of DeleteQueryBuilder.
-
whereCondition
Adds a WHERE condition to the DELETE query.- Parameters:
condition
- The WHERE condition to be added.- Returns:
- The current DeleteQueryBuilder instance for method chaining.
-
andCondition
Adds an AND condition to the existing WHERE conditions.- Parameters:
condition
- The AND condition to be added.- Returns:
- The current DeleteQueryBuilder instance for method chaining.
-
orCondition
Adds an OR condition to the existing WHERE conditions.- Parameters:
condition
- The OR condition to be added.- Returns:
- The current DeleteQueryBuilder instance for method chaining.
-
betweenCondition
Adds a BETWEEN condition to the existing WHERE conditions.- Parameters:
field
- The field to which the BETWEEN condition applies.lowerBound
- The lower bound of the range.upperBound
- The upper bound of the range.- Returns:
- The current DeleteQueryBuilder instance for method chaining.
-
buildDeleteStatement
Builds the DELETE SQL statement based on the configured conditions.- Returns:
- The generated DELETE SQL statement as a string.
-