Package com.redspr.redquerybuilder.core.client.expression

Examples of com.redspr.redquerybuilder.core.client.expression.ConditionAndOr


    public void addFilterCondition(Expression condition, boolean isJoin) {
        if (isJoin) {
            if (joinCondition == null) {
                joinCondition = condition;
            } else {
                joinCondition = new ConditionAndOr(session, ConditionAndOr.AND,
                        joinCondition, condition);
            }
        } else {
            if (filterCondition == null) {
                filterCondition = condition;
            } else {
                filterCondition = new ConditionAndOr(session,
                        ConditionAndOr.AND, filterCondition, condition);
            }
        }
    }
View Full Code Here


    public void addCondition(Expression cond) {
        Expression condition = getCondition();
        if (condition == null) {
            condition = cond;
        } else {
            condition = new ConditionAndOr(session, ConditionAndOr.AND, cond, condition);
        }
        setCondition(condition);
    }
View Full Code Here

    @Test
    public void testAndOrRemove() throws Exception {
        Session s = getSession();
        Nop a = new Nop();
        Nop b = new Nop();
        ConditionAndOr toGo = new ConditionAndOr(s, 0, a, b);
        ConditionAndOr root = new ConditionAndOr(s, 0, toGo, new Nop());
        toGo.remove(a);

        assertTrue(root.getLeft() == b);

        assertEquals("(1=1 AND 1=1)", root.getSQL(new ArrayList()));
    }
View Full Code Here

        RootPanel.get().add(cb);
        Select s = cb.getSelect();

       // cb.fireDirty();

        ConditionAndOr andOr = (ConditionAndOr) s.getCondition();
        Comparison comp = (Comparison) andOr.getLeft();
        Parameter right = (Parameter) comp.getRight();
        Element selectElmt = right.getElement();

        String html = "<input type='text' class='gwt-TextBox' value='13'>";
        assertEquals(html, selectElmt);
View Full Code Here

                                    .getTableAlias(), joinColumnName);
                            Expression equal = new Comparison(session, Operator.EQUAL, tableExpr, joinExpr);
                            if (on == null) {
                                on = equal;
                            } else {
                                on = new ConditionAndOr(session, ConditionAndOr.AND, on, equal);
                            }
                        }
                    }
                }
                top.addJoin(join, fromOuter, on);
View Full Code Here

    }

    private Expression readExpression() throws SQLException {
        Expression r = readAnd();
        while (readIf("OR")) {
            r = new ConditionAndOr(session, ConditionAndOr.OR, r, readAnd());
        }
        return r;
    }
View Full Code Here

    }

    private Expression readAnd() throws SQLException {
        Expression r = readCondition();
        while (readIf("AND")) {
            r = new ConditionAndOr(session, ConditionAndOr.AND, r, readCondition());
        }
        return r;
    }
View Full Code Here

TOP

Related Classes of com.redspr.redquerybuilder.core.client.expression.ConditionAndOr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.