Class FilterWhereBuilder

java.lang.Object
net.tirasa.connid.commons.db.FilterWhereBuilder

public class FilterWhereBuilder extends Object
The Filter Where builder is component intended to be used within subclass of * AbstractFilterTranslator to help create the database WHERE query clause.

The main functionality of this helper class is create SQL WHERE query clause

The builder can return a List of params to be used within preparedStatement creation

Since:
1.0
Version:
$Revision 1.0$
  • Constructor Details

    • FilterWhereBuilder

      public FilterWhereBuilder()
  • Method Details

    • join

      public void join(String operator, FilterWhereBuilder l, FilterWhereBuilder r)
      Compound join operator
      Parameters:
      operator - AND/OR
      l - left FilterQueryBuiler
      r - right FilterQueryBuiler
    • getParams

      public List<SQLParam> getParams()
      Returns:
      the params
    • getWhere

      public StringBuilder getWhere()
      Returns:
      the where
    • addBind

      public void addBind(SQLParam param, String operator, boolean lowercase)
      Add name value pair bindings with operator, this is lazy bindings resolved at getWhereClause()
      Parameters:
      param - value to builder
      operator - an operator to compare
      lowercase - whether case-insensitive comparison should be performed
      See Also:
    • addNull

      public void addNull(String name)
      Add null value.
      Parameters:
      name - of the column
      See Also:
    • isIn

      public boolean isIn()
      There is a need to put the content into brackets
      Returns:
      boolean a in
    • getWhereClause

      public String getWhereClause()
      Returns:
      the where clause as a String