Package org.hpccsystems.commons.filter
Class SQLFilter
- java.lang.Object
-
- org.hpccsystems.commons.filter.SQLFilter
-
public class SQLFilter extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static SQLOperator
andOperator
static String
andregex
static SQLOperator
orOperator
static String
orregex
-
Constructor Summary
Constructors Constructor Description SQLFilter()
Instantiates a new SQL filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExpression(SQLExpression expression)
Adds the expression.boolean
containsEqualityCondition(HashMap<String,String> map, String first, String second)
Contains equality condition.boolean
containsKey(String colname)
Contains key.String
fullToString()
Full to string.String[]
getExpressionColumnNames()
Gets the expression column names.String
getExpressionFromColumnName(String colname)
Gets the expression from column name.Iterator<SQLExpression>
getExpressions()
Gets the expressions.int
getExpressionsCount()
Gets the expressions count.Object[]
getUniqueExpressionColumnNames()
Gets the unique expression column names.boolean
isOrOperatorUsed()
Checks if is or operator used.void
parseWhereClause(String whereclause)
Parses the where clause.String
toString()
String
toStringTranslateSource(HashMap<String,String> map, boolean ignoreMisTranslations)
To string translate source.
-
-
-
Field Detail
-
andOperator
public static final SQLOperator andOperator
-
orOperator
public static final SQLOperator orOperator
-
andregex
public static final String andregex
-
orregex
public static final String orregex
-
-
Method Detail
-
addExpression
public void addExpression(SQLExpression expression)
Adds the expression.- Parameters:
expression
- the expression
-
getExpressions
public Iterator<SQLExpression> getExpressions()
Gets the expressions.- Returns:
- the expressions
-
getExpressionsCount
public int getExpressionsCount()
Gets the expressions count.- Returns:
- the expressions count
-
fullToString
public String fullToString()
Full to string.- Returns:
- the string
-
toStringTranslateSource
public String toStringTranslateSource(HashMap<String,String> map, boolean ignoreMisTranslations)
To string translate source.- Parameters:
map
- the mapignoreMisTranslations
- the ignore mis translations- Returns:
- the string
-
getExpressionColumnNames
public String[] getExpressionColumnNames()
Gets the expression column names.- Returns:
- the expression column names
-
getExpressionFromColumnName
public String getExpressionFromColumnName(String colname)
Gets the expression from column name.- Parameters:
colname
- the colname- Returns:
- the expression from column name
-
containsKey
public boolean containsKey(String colname)
Contains key.- Parameters:
colname
- the colname- Returns:
- true, if successful
-
getUniqueExpressionColumnNames
public Object[] getUniqueExpressionColumnNames()
Gets the unique expression column names.- Returns:
- the unique expression column names
-
isOrOperatorUsed
public boolean isOrOperatorUsed()
Checks if is or operator used.- Returns:
- true, if is or operator used
-
parseWhereClause
public void parseWhereClause(String whereclause) throws SQLException
Parses the where clause.- Parameters:
whereclause
- the whereclause- Throws:
SQLException
- the SQL exception
-
-