Class SQLWhereQuery<T>

java.lang.Object
ece.ing3.java.projet.database.sql.queries.SQLWhereQuery<T>
Type Parameters:
T - SQL helper class
All Implemented Interfaces:
SQLRequest
Direct Known Subclasses:
SQLDelete, SQLSelect, SQLUpdate

public abstract class SQLWhereQuery<T> extends Object implements SQLRequest
SQL helper for queries supporting Where clause. Must be used as a base class for a feature-complete SQL helper.
Author:
Virgile, Nicolas, Louis-Félix
  • Constructor Details

    • SQLWhereQuery

      public SQLWhereQuery()
  • Method Details

    • where

      public T where(Where condition)
      Init a new where clause.
      Parameters:
      condition - Where clause to use
      Returns:
      This SQL select helper
    • andWhere

      public T andWhere(Where condition)
      Chain a new Where clause using the boolean AND.
      Parameters:
      condition - Where clause to chain
      Returns:
      This SQL select helper
    • orWhere

      public T orWhere(Where condition)
      Chain a Where clause using the boolean OR.
      Parameters:
      condition - Where clause to chain
      Returns:
      This SQL select helper
    • where

      public T where(String column, String comparator, Object value)
      Init a new Where clause using the provided values.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      value - Comparison value
      Returns:
      This SQL select helper
    • andWhere

      public T andWhere(String column, String comparator, Object value)
      Chain a Where clause using the boolean AND, using the provided values.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      value - Comparison value
      Returns:
      This SQL select helper
    • orWhere

      public T orWhere(String column, String comparator, Object value)
      Chain a Where clause using the boolean OR, using the provided values.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      value - Comparison value
      Returns:
      This SQL select helper
    • where

      public T where(String column, String comparator, SQLRequest subquery)
      Init a new Where clause using the provided values and subquery.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      subquery - Comparison value
      Returns:
      This SQL select helper
    • andWhere

      public T andWhere(String column, String comparator, SQLRequest subquery)
      Chain a Where clause using the boolean AND, using the provided values and subquery.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      subquery - Comparison value
      Returns:
      This SQL select helper
    • orWhere

      public T orWhere(String column, String comparator, SQLRequest subquery)
      Chain a Where clause using the boolean OR, using the provided values and subquery.
      Parameters:
      column - Column to target
      comparator - Comparator to use
      subquery - Comparison value
      Returns:
      This SQL select helper
    • getParameters

      public List<Object> getParameters()
      Description copied from interface: SQLRequest
      Gets all the request's parameters
      Specified by:
      getParameters in interface SQLRequest
      Returns:
      Request parameters