Package org.modeshape.jcr.query.plan

Examples of org.modeshape.jcr.query.plan.PlanHints


            if (command == null) {
                // The query is not well-formed and cannot be parsed ...
                throw new InvalidQueryException(JcrI18n.queryCannotBeParsedUsingLanguage.text(language, expression));
            }
            // Set up the hints ...
            PlanHints hints = new PlanHints();
            hints.showPlan = true;
            hints.hasFullTextSearch = true; // always include the score
            hints.validateColumnExistance = false; // see MODE-1055
            if (parser.getLanguage().equals(QueryLanguage.JCR_SQL2)) {
                hints.qualifyExpandedColumnNames = true;
View Full Code Here


        }
        // Produce the expression string ...
        String expression = Visitors.readable(command);
        try {
            // Parsing must be done now ...
            PlanHints hints = new PlanHints();
            hints.showPlan = true;
            hints.hasFullTextSearch = true; // always include the score
            hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
            return resultWith(expression, QueryLanguage.JCR_SQL2, command, hints, null);
        } catch (org.modeshape.jcr.query.parse.InvalidQueryException e) {
View Full Code Here

                                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();
        result = new XPathQueryResult(context, query, graphResult, hints.restartable, hints.rowsKeptInMemory);
    }
View Full Code Here

        CheckArg.isNotNull(bufferManager, "bufferManager");
        this.context = context;
        this.repositoryCache = repositoryCache;
        this.workspaceNames = workspaceNames;
        this.typeSystem = context.getValueFactories().getTypeSystem();
        this.hints = hints != null ? hints : new PlanHints();
        this.indexDefns = indexDefns;
        this.schemata = schemata;
        this.nodeTypes = nodeTypes;
        this.problems = problems != null ? problems : new SimpleProblems();
        this.variables = variables != null ? new HashMap<String, Object>(variables) : new HashMap<String, Object>();
View Full Code Here

    @Override
    public org.modeshape.jcr.api.query.QueryResult explain() throws RepositoryException {
        context.checkValid();

        // Set to only compute the plan and then create an executable query ...
        PlanHints hints = this.hints.clone();
        hints.planOnly = true;
        CancellableQuery planOnlyExecutable = context.createExecutableQuery(query, hints, variables);

        // otherwise, some other thread called execute, so we can use it and just wait for the results ...
        final QueryResults result = planOnlyExecutable.execute(); // may be cancelled
View Full Code Here

        SelectQuery query = select(source, constraint, orderings, columns, null, false);
        // Produce the statement, but use our ExecutionContext (primarily for namespaces and binary value usage) ...
        String statement = Visitors.readable(query, context.getExecutionContext());
        // Set up the hints ...
        PlanHints hints = new PlanHints();
        hints.showPlan = true;
        hints.hasFullTextSearch = true; // always include the score
        hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
        // We want to allow use of residual properties (not in the schemata) for criteria ...
        hints.validateColumnExistance = false;   // see MODE-1055
View Full Code Here

    @Override
    public SetQueryObjectModel createQuery( org.modeshape.jcr.api.query.qom.SetQuery command ) {
        SetQuery setQuery = CheckArg.getInstanceOf(command, SetQuery.class, "command");
        String statement = setQuery.toString();
        // Set up the hints ...
        PlanHints hints = new PlanHints();
        hints.showPlan = true;
        hints.hasFullTextSearch = true; // always include the score
        hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
        // We want to allow use of residual properties (not in the schemata) for criteria ...
        hints.validateColumnExistance = false; // see MODE-1055
View Full Code Here

    @Override
    public QueryObjectModel createQuery( org.modeshape.jcr.api.query.qom.SelectQuery command ) {
        SelectQuery selectQuery = CheckArg.getInstanceOf(command, SelectQuery.class, "command");
        String statement = selectQuery.toString();
        // Set up the hints ...
        PlanHints hints = new PlanHints();
        hints.showPlan = true;
        hints.hasFullTextSearch = true; // always include the score
        hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
        // We want to allow use of residual properties (not in the schemata) for criteria ...
        hints.validateColumnExistance = false// see MODE-1055
View Full Code Here

     * @param context the query context; may not be null
     * @return the representation of the projected columns; never null
     */
    protected Columns determineProjectedColumns( PlanNode optimizedPlan,
                                                 final ScanQueryContext context ) {
        final PlanHints hints = context.getHints();

        // Look for which columns to include in the results; this will be defined by the highest PROJECT node ...
        PlanNode project = optimizedPlan;
        if (project.getType() != Type.PROJECT) {
            project = optimizedPlan.findAtOrBelow(Traversal.LEVEL_ORDER, Type.PROJECT);
View Full Code Here

                // Query context for the join (must remove isExists condition).
                ScanQueryContext joinQueryContext = context;
                if (context.getHints().isExistsQuery) {
                    // must not push down a LIMIT 1 condition to joins.
                    PlanHints joinPlanHints = context.getHints().clone();
                    joinPlanHints.isExistsQuery = false;
                    joinQueryContext = context.with(joinPlanHints);
                }

                NodeSequence left = createNodeSequence(originalQuery, joinQueryContext, leftPlan, leftColumns, sources);
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.plan.PlanHints

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.