Package org.jboss.dna.graph.query.model

Examples of org.jboss.dna.graph.query.model.Limit


                                                                    columns,
                                                                    analyzer);
                // Then create the limit component ...
                Integer rowLimit = node.getProperty(Property.LIMIT_COUNT, Integer.class);
                Integer offset = node.getProperty(Property.LIMIT_OFFSET, Integer.class);
                Limit limit = Limit.NONE;
                if (rowLimit != null) limit = limit.withRowLimit(rowLimit.intValue());
                if (offset != null) limit = limit.withOffset(offset.intValue());
                component = new LimitComponent(limitDelegate, limit);
                break;
            case NULL:
                component = new NoResultsComponent(context, columns);
                break;
View Full Code Here


            andedConstraints.add(selectConstraint);
        }
        this.andedConstraints = andedConstraints != null ? andedConstraints : Collections.<Constraint>emptyList();

        // Find the limit ...
        Limit limit = Limit.NONE;
        PlanNode limitNode = accessNode.findAtOrBelow(Type.LIMIT);
        if (limitNode != null) {
            Integer count = limitNode.getProperty(Property.LIMIT_COUNT, Integer.class);
            if (count != null) limit = limit.withRowLimit(count.intValue());
            Integer offset = limitNode.getProperty(Property.LIMIT_OFFSET, Integer.class);
            if (offset != null) limit = limit.withOffset(offset.intValue());
        }
        this.limit = limit;
    }
View Full Code Here

        List<ColumnExpression> columnExpressions = parseSelect(tokens, isDistinct, typeSystem);
        Source source = parseFrom(tokens, typeSystem);
        Constraint constraint = parseWhere(tokens, typeSystem, source);
        // Parse the order by and limit (can be in any order) ...
        List<Ordering> orderings = parseOrderBy(tokens, typeSystem, source);
        Limit limit = parseLimit(tokens);
        if (orderings == null) parseOrderBy(tokens, typeSystem, source);

        // Convert the column expressions to columns ...
        List<Column> columns = new ArrayList<Column>(columnExpressions.size());
        for (ColumnExpression expression : columnExpressions) {
View Full Code Here

                                                                                             to,
                                                                                             pos.getLine(),
                                                                                             pos.getColumn());
                    throw new ParsingException(pos, msg);
                }
                return new Limit(offset, first);
            }
            if (tokens.canConsume("OFFSET")) {
                int offset = tokens.consumeInteger();
                return new Limit(first, offset);
            }
            // No offset
            return new Limit(first, 0);
        }
        return null;
    }
View Full Code Here

        assertThat(source, is(instanceOf(Selector.class)));
        SelectorName tableName = ((Selector)source).getName();
        Constraint constraint = query.getConstraint();
        Columns resultColumns = new QueryResultColumns(query.getColumns(), QueryResultColumns.includeFullTextScores(constraint));
        List<Constraint> andedConstraints = getAndedConstraint(constraint, new ArrayList<Constraint>());
        Limit limit = query.getLimits();
        RequestProcessor processor = engine.createProcessor(context, null, true);
        try {
            AccessQueryRequest request = new AccessQueryRequest(workspaceName, tableName, resultColumns, andedConstraints, limit,
                                                                schemata, variables);
            processor.process(request);
View Full Code Here

        assertThat(source, is(instanceOf(Selector.class)));
        SelectorName tableName = ((Selector)source).getName();
        Constraint constraint = query.getConstraint();
        Columns resultColumns = new QueryResultColumns(query.getColumns(), QueryResultColumns.includeFullTextScores(constraint));
        List<Constraint> andedConstraints = getAndedConstraint(constraint, new ArrayList<Constraint>());
        Limit limit = query.getLimits();
        RequestProcessor processor = searchEngine.createProcessor(context, null, true);
        try {
            AccessQueryRequest request = new AccessQueryRequest(workspaceName, tableName, resultColumns, andedConstraints, limit,
                                                                schemata, variables);
            processor.process(request);
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.query.model.Limit

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.