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 SQLOperatorandOperatorstatic Stringandregexstatic SQLOperatororOperatorstatic Stringorregex
-
Constructor Summary
Constructors Constructor Description SQLFilter()Instantiates a new SQL filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExpression(SQLExpression expression)Adds the expression.booleancontainsEqualityCondition(HashMap<String,String> map, String first, String second)Contains equality condition.booleancontainsKey(String colname)Contains key.StringfullToString()Full to string.String[]getExpressionColumnNames()Gets the expression column names.StringgetExpressionFromColumnName(String colname)Gets the expression from column name.Iterator<SQLExpression>getExpressions()Gets the expressions.intgetExpressionsCount()Gets the expressions count.Object[]getUniqueExpressionColumnNames()Gets the unique expression column names.booleanisOrOperatorUsed()Checks if is or operator used.voidparseWhereClause(String whereclause)Parses the where clause.StringtoString()StringtoStringTranslateSource(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
-
-