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

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


                            // XXX need to do distinct?
                            ObjectArray expr = ObjectArray.newInstance();
                            TableFilter tf = session.getFilters().get(0);
                            String alias = tf.getAlias();
                            for (Column col : tf.getTable().getColumns()) {
                                expr.add(new ExpressionColumn(session, null, alias,
                                    col.getName()));
                            }
                            builder.getSelect().setExpressions(expr);
                        } else {
                            builder.getSelect().setExpressions(null);
View Full Code Here


        TableFilter refTableFilter = session.createTableFilter(ref
                .getRefTable());

        Comparison joinCond = new Comparison(session, Operator.EQUAL,
                new ExpressionColumn(session, null, tableFilter.getAlias(), ref
                        .getColumns()[0].getName()), new ExpressionColumn(
                        session, null, refTableFilter.getAlias(), ref
                                .getRefColumns()[0].getName()));
        tableFilter.addJoin(refTableFilter, false, joinCond);
        return refTableFilter;
    }
View Full Code Here

            return false;
        }
        if (!(c.getRight() instanceof ExpressionColumn)) {
            return false;
        }
        ExpressionColumn left = (ExpressionColumn) c.getLeft();
        ExpressionColumn right = (ExpressionColumn) c.getRight();
        if (left.getTableFilter() == child) {
            foo(right.getTableFilter());
            childCols.add(left.getColumn());
            parentCols.add(right.getColumn());
        } else if (right.getTableFilter() == child) {
            foo(left.getTableFilter());
            childCols.add(right.getColumn());
            parentCols.add(left.getColumn());
        } else {
            return false;
        }
return true;
View Full Code Here

            used.add(null);
            Callback counter = new BaseSqlWidget.Callback() {
                @Override
                public void handle(BaseSqlWidget w) {
                    if (w instanceof ExpressionColumn) {
                        ExpressionColumn ec = (ExpressionColumn) w;
                        TableFilter tf = ec.getTableFilter();
                        if (used.add(tf)) {
                            if (tf.getJoinCondition() != null) {
                                tf.getJoinCondition().traverse(this);
                            }
                        }
View Full Code Here

                    String tableColumnName = tc.getName();
                    for (Column c : joinCols) {
                        String joinColumnName = c.getName();
                        if (tableColumnName.equals(joinColumnName)) {
                            // XXX join.addNaturalJoinColumn(c);
                            Expression tableExpr = new ExpressionColumn(session, tableSchema, last
                                    .getTableAlias(), tableColumnName);
                            Expression joinExpr = new ExpressionColumn(session, joinSchema, join
                                    .getTableAlias(), joinColumnName);
                            Expression equal = new Comparison(session, Operator.EQUAL, tableExpr, joinExpr);
                            if (on == null) {
                                on = equal;
                            } else {
View Full Code Here

//                name = readColumnIdentifier();
//                return new ExpressionColumn(database, schema, objectName, name);
//            }
//            return new ExpressionColumn(database, schema, objectName, name);
//        }
        return new ExpressionColumn(session, null, objectName, name);
    }
View Full Code Here

//                } else if ("E".equals(name) && currentTokenType == VALUE && currentValue.getType() == Value.STRING) {
//                    String text = currentValue.getString();
//                    read();
//                    r = ValueExpression.get(ValueString.get(text));
                } else {
                    r = new ExpressionColumn(session, null, null, name);
                }
//            }
            break;
//        case MINUS:
//            read();
View Full Code Here

public class GwtTestBasics extends AbstractTest {
    @Test
    public void testComparison() throws Exception {
        Parser p = new Parser(getSession());
        Comparison c = (Comparison) p.parseExpression("id = ?");
        ExpressionColumn left = (ExpressionColumn) c.getLeft();
        Parameter param = (Parameter) c.getRight();
    }
View Full Code Here

        Parser p = new Parser(getSession());
        Prepared prep = p.parseOnly("SELECT id FROM Person WHERE sex = ?");

        Select s = (Select) prep;
        assertTrue(s != null);
        ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);
        assertEquals("ID", ec.getSQL(new ArrayList()));

        assertEquals(1, s.getFilters().size());
        TableFilter tf = s.getFilters().get(0);
        assertTrue(tf != null);
        assertEquals("PERSON", tf.getTable().getName());
View Full Code Here

        sess.getValueRegistry().add("foo");
        Prepared prep = p.parseOnly("SELECT id FROM Person x1 WHERE x1.sex = ?");

        Select s = (Select) prep;
        assertTrue(s != null);
        ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);

        assertEquals("ID", ec.getSQL(new ArrayList()));

        assertEquals(1, s.getFilters().size());
        TableFilter tf = s.getFilters().get(0);
        assertTrue(tf != null);
        assertEquals("PERSON", tf.getTable().getName());
View Full Code Here

TOP

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

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.