java.lang.Object
io.github.blyznytsiaorg.bibernate.dao.jdbc.dsl.QueryBuilder
Direct Known Subclasses:
DeleteQueryBuilder, InsertQueryBuilder, SelectQueryBuilder, UpdateQueryBuilder

abstract class QueryBuilder extends Object
An abstract class representing a generic SQL query builder with common constants and methods for constructing SQL statements such as SELECT, UPDATE, DELETE, etc.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The wildcard character representing all fields in SELECT statements.
    static final String
    The logical AND operator for combining conditions in WHERE clauses.
    static final String
    The AS for aliases
    static final String
    The template for BETWEEN conditions with placeholders for field, lower bound, and upper bound.
    static final String
    Represents the close parenthesis ")" in SQL.
    static final String
    The comma used to separate elements in SQL statements.
    static final String
    The SQL keyword for DELETE statements.
    static final String
    The dot used to separate table and column names in SQL statements.
    static final String
    The equality operator used in WHERE clauses.
    static final String
    The SQL keyword for FROM clauses in SELECT statements.
    static final String
    The SQL keyword for GROUP BY clauses.
    static final String
    The SQL keyword for HAVING clauses.
    static final String
    The logical IN operator for combining conditions in WHERE clauses.
    static final String
    The SQL template for INSERT INTO statements with placeholders for table name, field names, and values.
    static final String
    Represents the open parenthesis "(" in SQL.
    static final String
    The logical OR operator for combining conditions in WHERE clauses.
    static final String
    The parameter placeholder used for prepared statements.
    static final String
    The SQL keyword for SELECT statements.
    static final String
    The semicolon used to terminate SQL statements.
    static final String
    The SQL keyword for SET clauses in UPDATE statements.
    static final String
    The space character used in SQL statements for better readability.
    protected final String
    The name of the table being queried or modified.
    static final String
    The underscore is used to sepa
    static final String
    The SQL keyword for UNION clauses.
    static final String
    The SQL keyword for UPDATE statements.
    static final String
    The SQL keyword for WHERE clauses.
    protected final List<String>
    The list of conditions used in WHERE clauses.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QueryBuilder(String tableName, List<String> whereConditions)
    Constructs a new QueryBuilder with the specified table name and list of WHERE conditions.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Appends the WHERE clause to the provided query builder if there are any conditions specified.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • QueryBuilder

      QueryBuilder(String tableName, List<String> whereConditions)
      Constructs a new QueryBuilder with the specified table name and list of WHERE conditions.
      Parameters:
      tableName - The name of the table being queried or modified.
      whereConditions - The list of conditions used in WHERE clauses.
  • Method Details

    • handleWhereCondition

      protected void handleWhereCondition(StringBuilder queryBuilder)
      Appends the WHERE clause to the provided query builder if there are any conditions specified.
      Parameters:
      queryBuilder - The StringBuilder to which the WHERE clause is appended.