Package org.modeshape.jcr.query.model

Examples of org.modeshape.jcr.query.model.Column


                columnName = parts[0];
            } else {
                throw new IllegalArgumentException(GraphI18n.columnMustBeScoped.text(parts[0]));
            }
        }
        return new Column(name, propertyName, columnName);
    }
View Full Code Here


    public QueryBuilder fromAllNodesAs( String alias ) {
        AllNodes allNodes = new AllNodes(selector(alias));
        SelectorName oldName = this.source instanceof Selector ? ((Selector)source).name() : null;
        // Go through the columns and change the selector name to use the new alias ...
        for (int i = 0; i != columns.size(); ++i) {
            Column old = columns.get(i);
            if (old.selectorName().equals(oldName)) {
                columns.set(i, new Column(allNodes.aliasOrName(), old.getPropertyName(), old.getColumnName()));
            }
        }
        this.source = allNodes;
        return this;
    }
View Full Code Here

    public QueryBuilder from( String tableNameWithOptionalAlias ) {
        Selector selector = namedSelector(tableNameWithOptionalAlias);
        SelectorName oldName = this.source instanceof Selector ? ((Selector)source).name() : null;
        // Go through the columns and change the selector name to use the new alias ...
        for (int i = 0; i != columns.size(); ++i) {
            Column old = columns.get(i);
            if (old.selectorName().equals(oldName)) {
                columns.set(i, new Column(selector.aliasOrName(), old.getPropertyName(), old.getColumnName()));
            }
        }
        this.source = selector;
        return this;
    }
View Full Code Here

            assertThat(node.hasCollectionProperty(Property.PROJECT_COLUMNS), is(true));
        }
        List<Column> columns = node.getProperty(Property.PROJECT_COLUMNS, List.class);
        assertThat(columns.size(), is(columnNames.length));
        for (int i = 0; i != columns.size(); ++i) {
            Column column = columns.get(i);
            assertThat(column.getColumnName(), is(columnNames[i]));
        }
    }
View Full Code Here

        query = "SELECT jcr:primaryType, foo:bar FROM nt:unstructured";
        graphResult = mock(QueryResults.class);
        columnTypes = Arrays.asList("STRING", "LONG");
        columnNames = Arrays.asList("jcr:primaryType", "foo:bar");
        SelectorName tableName = new SelectorName("nt:unstructured");
        columns = Arrays.asList(new Column(tableName, columnNames.get(0), columnNames.get(0)),
                                new Column(tableName, columnNames.get(1), columnNames.get(1)));
        resultColumns = new ScanningQueryEngine.ResultColumns(columns, columnTypes, true, null);
        when(graphResult.getColumns()).thenReturn(resultColumns);
        when(graphResult.getRows()).thenReturn(NodeSequence.emptySequence(1));

        PlanHints hints = new PlanHints();
View Full Code Here

        return new SelectorName(selectorName);
    }

    protected Column column( SelectorName selector,
                             String property ) {
        return new Column(selector, property, property);
    }
View Full Code Here

    }

    protected Column column( SelectorName selector,
                             String property,
                             String alias ) {
        return new Column(selector, property, alias);
    }
View Full Code Here

        return Arrays.asList(columns);
    }

    protected Column column( String table,
                             String columnName ) {
        return new Column(new SelectorName(table), columnName, columnName);
    }
View Full Code Here

    }

    protected Column column( String table,
                             String columnName,
                             String alias ) {
        return new Column(new SelectorName(table), columnName, alias);
    }
View Full Code Here

    }

    protected Column column( String table,
                             String columnName ) {
        if (multipleSelectors) {
            return new Column(new SelectorName(table), columnName, table + "." + columnName);
        }
        return new Column(new SelectorName(table), columnName, columnName);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.model.Column

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.