Package net.tirasa.connid.commons.db
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 *AbstractFilterTranslatorto 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 Summary
Constructors Constructor Description FilterWhereBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBind(SQLParam param, String operator, boolean lowercase)Add name value pair bindings with operator, this is lazy bindings resolved atgetWhereClause()voidaddNull(String name)Add null value.List<SQLParam>getParams()StringBuildergetWhere()StringgetWhereClause()booleanisIn()There is a need to put the content into bracketsvoidjoin(String operator, FilterWhereBuilder l, FilterWhereBuilder r)Compound join operator
-
-
-
Method Detail
-
join
public void join(String operator, FilterWhereBuilder l, FilterWhereBuilder r)
Compound join operator- Parameters:
operator- AND/ORl- leftFilterQueryBuilerr- rightFilterQueryBuiler
-
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 atgetWhereClause()- Parameters:
param- value to builderoperator- an operator to comparelowercase- whether case-insensitive comparison should be performed- See Also:
getWhereClause()
-
addNull
public void addNull(String name)
Add null value.- Parameters:
name- of the column- See Also:
getWhereClause()
-
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
-
-