|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.query.sql.LanguageVisitor
com.metamatrix.query.sql.visitor.ExpressionMappingVisitor
com.metamatrix.query.sql.visitor.CriteriaTranslatorVisitor
public class CriteriaTranslatorVisitor
This class is used to translate criteria specified on the user's update command against the virtual group, the elements on this criteria are replaced by elements on the query transformation that defines the virtual group. Parts of the criteria are selectively translated if a CriteriaSelector is specified, also if the user explicty defines translations for some of the elements those translations override any symbol mappings.
Constructor Summary | |
---|---|
CriteriaTranslatorVisitor()
This constructor initialises the visitor |
|
CriteriaTranslatorVisitor(java.util.Map symbolMap)
This constructor initializes this object by setting the symbolMap. |
Method Summary | |
---|---|
java.util.Map<ElementSymbol,Reference> |
getImplicitParams()
|
Criteria |
getTranslatedCriteria()
Gets the criteria translated by this visitor, differrent parts of the user's criteria are translated and they are combined as a CompoundCriteria
using an AND operator. |
Expression |
replaceExpression(Expression obj)
|
void |
setCriteriaSelector(CriteriaSelector selector)
Set the criteria selector used to restrict the part of the criteria that needs to be translated. |
void |
setTranslations(java.util.Collection translations)
Set the translations to be used to replace elements on the user's command against the virtual group. |
void |
visit(BetweenCriteria obj)
This method updates the BetweenCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions. |
void |
visit(CompareCriteria obj)
This method updates the CompareCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions. |
void |
visit(DependentSetCriteria obj)
This method updates the SetCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions |
void |
visit(IsNullCriteria obj)
This method updates the IsNullCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions. |
void |
visit(MatchCriteria obj)
This method updates the MatchCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions |
void |
visit(SetCriteria obj)
This method updates the SetCriteria object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions |
Methods inherited from class com.metamatrix.query.sql.visitor.ExpressionMappingVisitor |
---|
createAliases, getVariableValues, mapExpressions, setVariableValues, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
Methods inherited from class com.metamatrix.query.sql.LanguageVisitor |
---|
setAbort, shouldAbort, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CriteriaTranslatorVisitor()
This constructor initialises the visitor
public CriteriaTranslatorVisitor(java.util.Map symbolMap)
This constructor initializes this object by setting the symbolMap.
symbolMap
- A map of virtual elements to their counterparts in transform
defining the virtual groupMethod Detail |
---|
public void setCriteriaSelector(CriteriaSelector selector)
Set the criteria selector used to restrict the part of the criteria that needs to be translated.
selector
- The CriteriaSelector
on the TranslateCriteria
objectpublic void setTranslations(java.util.Collection translations)
Set the translations to be used to replace elements on the user's command against the virtual group.
translations
- Collection of ComapreCriteria
objects used to
specify translationspublic void visit(BetweenCriteria obj)
This method updates the BetweenCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions.
visit
in class ExpressionMappingVisitor
obj
- The BetweenCriteria object to be updated with translated expressionsLanguageVisitor.visit(BetweenCriteria)
public void visit(CompareCriteria obj)
This method updates the CompareCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions.
visit
in class ExpressionMappingVisitor
obj
- The CompareCriteria object to be updated with translated expressionsLanguageVisitor.visit(CompareCriteria)
public void visit(IsNullCriteria obj)
This method updates the IsNullCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions.
visit
in class ExpressionMappingVisitor
obj
- The IsNullCriteria object to be updated with translated expressionsLanguageVisitor.visit(IsNullCriteria)
public void visit(MatchCriteria obj)
This method updates the MatchCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions
visit
in class ExpressionMappingVisitor
obj
- The SetCriteria object to be updated with translated expressionsLanguageVisitor.visit(MatchCriteria)
public void visit(SetCriteria obj)
This method updates the SetCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions
visit
in class ExpressionMappingVisitor
obj
- The SetCriteria object to be updated with translated expressionsLanguageVisitor.visit(SetCriteria)
public void visit(DependentSetCriteria obj)
This method updates the SetCriteria
object it receives as an
argument by replacing the virtual elements present in the expressions in the
function with translated expressions
visit
in class ExpressionMappingVisitor
obj
- The SetCriteria object to be updated with translated expressionspublic Expression replaceExpression(Expression obj)
replaceExpression
in class ExpressionMappingVisitor
public Criteria getTranslatedCriteria()
Gets the criteria translated by this visitor, differrent parts of the user's
criteria are translated and they are combined as a CompoundCriteria
using an AND operator. Returns a null if no part of the user's criteria could
be translated.
public java.util.Map<ElementSymbol,Reference> getImplicitParams()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |