Package org.hpccsystems.commons.filter
Class SQLExpression
- java.lang.Object
-
- org.hpccsystems.commons.filter.SQLExpression
-
public class SQLExpression extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static charPARENTFIELDSEPstatic charSINGLEBLANKBUFFER
-
Constructor Summary
Constructors Constructor Description SQLExpression()Instantiates a new SQL expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(String colname)Contains key.StringgetFullPostfix()Gets the full postfix.StringgetFullPrefix()Gets the full prefix.SQLOperatorgetOperator()Gets the operator.SQLFragment.FragmentTypegetPostfixType()Gets the postfix type.StringgetPostfixValue()Gets the postfix value.SQLFragment.FragmentTypegetPrefixType()Gets the prefix type.StringgetPrefixValue()Gets the prefix value.SQLOperatorgetPreviousExpUnifier()Gets the previous exp unifier.booleanisEqualityCondition(HashMap<String,String> map, String first, String second)Checks if is equality condition.booleanisOperatorValid()Checks if is operator valid.booleanisPostfixParameterized()Checks if is postfix parameterized.booleanisPrefixParameterized()Checks if is prefix parameterized.voidParseExpression(String expression)Parses the expression.voidsetOperator(String operator)Sets the operator.voidsetOperator(SQLOperator operator)Sets the operator.voidsetPostfix(String postfixstr)Sets the postfix.voidsetPostfix(SQLFragment postfix)Sets the postfix.voidsetPrefix(String prefix)Sets the prefix.voidsetPrefix(SQLFragment prefix)Sets the prefix.voidsetPreviousExpUnifier(SQLOperator prevexpunifier)Sets the previous exp unifier.StringtoString()StringtoStringFull(boolean outputfull)To string full.StringtoStringTranslateSource(HashMap<String,String> map, boolean ignoreprevunifier, boolean ignoreMisTraslations)To string translate source.voidupdateFragmentTables(List<SQLTable> sqlTables)Update fragment tables.
-
-
-
Field Detail
-
PARENTFIELDSEP
public static final char PARENTFIELDSEP
- See Also:
- Constant Field Values
-
SINGLEBLANKBUFFER
public static final char SINGLEBLANKBUFFER
- See Also:
- Constant Field Values
-
-
Method Detail
-
ParseExpression
public void ParseExpression(String expression) throws SQLException
Parses the expression.- Parameters:
expression- the expression- Throws:
SQLException- the SQL exception
-
getPrefixValue
public String getPrefixValue()
Gets the prefix value.- Returns:
- the prefix value
-
getFullPrefix
public String getFullPrefix()
Gets the full prefix.- Returns:
- the full prefix
-
getFullPostfix
public String getFullPostfix()
Gets the full postfix.- Returns:
- the full postfix
-
setPrefix
public void setPrefix(String prefix)
Sets the prefix.- Parameters:
prefix- the new prefix
-
getOperator
public SQLOperator getOperator()
Gets the operator.- Returns:
- the operator
-
setOperator
public void setOperator(SQLOperator operator)
Sets the operator.- Parameters:
operator- the new operator
-
setOperator
public void setOperator(String operator)
Sets the operator.- Parameters:
operator- the new operator
-
isOperatorValid
public boolean isOperatorValid()
Checks if is operator valid.- Returns:
- true, if is operator valid
-
getPostfixValue
public String getPostfixValue()
Gets the postfix value.- Returns:
- the postfix value
-
setPostfix
public void setPostfix(String postfixstr)
Sets the postfix.- Parameters:
postfixstr- the new postfix
-
isPrefixParameterized
public boolean isPrefixParameterized()
Checks if is prefix parameterized.- Returns:
- true, if is prefix parameterized
-
isPostfixParameterized
public boolean isPostfixParameterized()
Checks if is postfix parameterized.- Returns:
- true, if is postfix parameterized
-
getPrefixType
public SQLFragment.FragmentType getPrefixType()
Gets the prefix type.- Returns:
- the prefix type
-
getPostfixType
public SQLFragment.FragmentType getPostfixType()
Gets the postfix type.- Returns:
- the postfix type
-
toStringFull
public String toStringFull(boolean outputfull)
To string full.- Parameters:
outputfull- the outputfull- Returns:
- the string
-
toStringTranslateSource
public String toStringTranslateSource(HashMap<String,String> map, boolean ignoreprevunifier, boolean ignoreMisTraslations)
To string translate source.- Parameters:
map- the mapignoreprevunifier- the ignoreprevunifierignoreMisTraslations- the ignore mis traslations- Returns:
- the string
-
isEqualityCondition
public boolean isEqualityCondition(HashMap<String,String> map, String first, String second)
Checks if is equality condition.- Parameters:
map- the mapfirst- the firstsecond- the second- Returns:
- true, if is equality condition
-
setPrefix
public void setPrefix(SQLFragment prefix)
Sets the prefix.- Parameters:
prefix- the new prefix
-
setPostfix
public void setPostfix(SQLFragment postfix)
Sets the postfix.- Parameters:
postfix- the new postfix
-
updateFragmentTables
public void updateFragmentTables(List<SQLTable> sqlTables) throws Exception
Update fragment tables.- Parameters:
sqlTables- the sql tables- Throws:
Exception- the exception
-
containsKey
public boolean containsKey(String colname)
Contains key.- Parameters:
colname- the colname- Returns:
- true, if successful
-
setPreviousExpUnifier
public void setPreviousExpUnifier(SQLOperator prevexpunifier)
Sets the previous exp unifier.- Parameters:
prevexpunifier- the new previous exp unifier
-
getPreviousExpUnifier
public SQLOperator getPreviousExpUnifier()
Gets the previous exp unifier.- Returns:
- the previous exp unifier
-
-