Search in sources :

Example 11 with AstBeSqlSubQuery

use of com.developmentontheedge.sql.model.AstBeSqlSubQuery in project be5 by DevelopmentOnTheEdge.

the class ContextApplier method checkExpression.

private void checkExpression(SimpleNode newTree, String key, Function<String, String> varResolver) {
    for (int i = 0; i < newTree.jjtGetNumChildren(); i++) {
        SimpleNode child = newTree.child(i);
        checkExpression(child, key, varResolver);
        if (child instanceof AstBeCondition)
            i = applyConditions(newTree, i);
        if (child instanceof AstBeParameterTag)
            applyParameterTag(newTree, i, key, varResolver);
        else if (child instanceof AstBePlaceHolder)
            applyPlaceHolder((AstBePlaceHolder) child);
        else if (child instanceof AstBeSessionTag)
            applySessionTag((AstBeSessionTag) child);
        else if (child instanceof AstBeSqlSubQuery)
            applySubQuery((AstBeSqlSubQuery) child);
        else if (child instanceof AstBeSqlAuto)
            applyAutoQuery((AstBeSqlAuto) child);
        else if (child instanceof AstBeConditionChain) {
            applyConditionChain((AstBeConditionChain) child);
            i--;
        } else if (child instanceof AstBeSql)
            applySqlTag((AstBeSql) child);
        else if (child instanceof AstBeDictionary)
            applyDictionary((AstBeDictionary) child);
    }
}
Also used : AstBeCondition(com.developmentontheedge.sql.model.AstBeCondition) AstBePlaceHolder(com.developmentontheedge.sql.model.AstBePlaceHolder) AstBeSessionTag(com.developmentontheedge.sql.model.AstBeSessionTag) AstBeSql(com.developmentontheedge.sql.model.AstBeSql) AstBeConditionChain(com.developmentontheedge.sql.model.AstBeConditionChain) AstBeSqlSubQuery(com.developmentontheedge.sql.model.AstBeSqlSubQuery) AstBeParameterTag(com.developmentontheedge.sql.model.AstBeParameterTag) AstBeSqlAuto(com.developmentontheedge.sql.model.AstBeSqlAuto) SimpleNode(com.developmentontheedge.sql.model.SimpleNode) AstBeDictionary(com.developmentontheedge.sql.model.AstBeDictionary)

Aggregations

AstBeSqlSubQuery (com.developmentontheedge.sql.model.AstBeSqlSubQuery)11 ContextApplier (com.developmentontheedge.sql.format.ContextApplier)6 AstStart (com.developmentontheedge.sql.model.AstStart)6 Test (org.junit.Test)6 HashMap (java.util.HashMap)5 BasicQueryContext (com.developmentontheedge.sql.format.BasicQueryContext)3 QueryResolver (com.developmentontheedge.sql.format.BasicQueryContext.QueryResolver)3 SqlQuery (com.developmentontheedge.sql.model.SqlQuery)3 Collections (java.util.Collections)3 Map (java.util.Map)3 Assert (org.junit.Assert)3 Ignore (org.junit.Ignore)3 SimpleNode (com.developmentontheedge.sql.model.SimpleNode)2 Be5Exception (com.developmentontheedge.be5.api.exceptions.Be5Exception)1 DynamicProperty (com.developmentontheedge.beans.DynamicProperty)1 DynamicPropertySet (com.developmentontheedge.beans.DynamicPropertySet)1 DynamicPropertySetSupport (com.developmentontheedge.beans.DynamicPropertySetSupport)1 Formatter (com.developmentontheedge.sql.format.Formatter)1 AstBeCondition (com.developmentontheedge.sql.model.AstBeCondition)1 AstBeConditionChain (com.developmentontheedge.sql.model.AstBeConditionChain)1