Examples of QueryEngine


Examples of org.apache.jackrabbit.core.query.lucene.join.QueryEngine

        long time = System.currentTimeMillis();
        final QueryResult result = sessionContext.getSessionState().perform(
                new SessionOperation<QueryResult>() {
                    public QueryResult perform(SessionContext context)
                            throws RepositoryException {
                        final QueryEngine engine = new QueryEngine(
                                sessionContext.getSessionImpl(), lqf, variables);
                        return engine.execute(getColumns(), getSource(),
                                getConstraint(), getOrderings(), offset, limit);
                    }
                    public String toString() {
                        return "query.execute(" + statement + ")";
                    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.join.QueryEngine

                variables);
        setInitialized();
    }

    public QueryResult execute() throws RepositoryException {
        QueryEngine engine = new QueryEngine(sessionContext.getSessionImpl(),
                lqf, variables);
        long time = System.currentTimeMillis();
        QueryResult qr = engine.execute(getColumns(), getSource(),
                getConstraint(), getOrderings(), offset, limit);
        if (log.isDebugEnabled()) {
            time = System.currentTimeMillis() - time;
            log.debug("executed in {} ms. ({})", time, statement);
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.join.QueryEngine

        long time = System.nanoTime();
        final QueryResult result = sessionContext.getSessionState().perform(
                new SessionOperation<QueryResult>() {
                    public QueryResult perform(SessionContext context)
                            throws RepositoryException {
                        final QueryEngine engine = new QueryEngine(
                                sessionContext.getSessionImpl(), lqf, variables);
                        return engine.execute(getColumns(), getSource(),
                                getConstraint(), getOrderings(), offset, limit);
                    }

                    public String toString() {
                        return "query.execute(" + statement + ")";
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

        }
        stmt.append(']');
        stmt.append(" order by jcr:path");

        try {
            QueryEngine queryEngine = root.getQueryEngine();
            return queryEngine.executeQuery(stmt.toString(), Query.XPATH, Long.MAX_VALUE, 0, Collections.<String, PropertyValue>emptyMap(), NamePathMapper.DEFAULT);
        } catch (ParseException e) {
            String msg = "Error while collecting effective policies.";
            log.error(msg, e.getMessage());
            throw new RepositoryException(msg, e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

        }
        stmt.append(']');
        stmt.append(" order by jcr:path");

        try {
            QueryEngine queryEngine = root.getQueryEngine();
            return queryEngine.executeQuery(stmt.toString(), Query.XPATH, Long.MAX_VALUE, 0, Collections.<String, PropertyValue>emptyMap(), NamePathMapper.DEFAULT);
        } catch (ParseException e) {
            String msg = "Error while collecting effective policies.";
            log.error(msg, e.getMessage());
            throw new RepositoryException(msg, e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

    private Iterator<Authorizable> findAuthorizables(@Nonnull String statement,
                                                     long limit,
                                                     long offset,
                                                     @Nullable AuthorizableType type) throws RepositoryException {
        try {
            QueryEngine queryEngine = root.getQueryEngine();
            Iterable<? extends ResultRow> resultRows = queryEngine.executeQuery(statement, javax.jcr.query.Query.XPATH, limit, offset, null, namePathMapper).getRows();
            Iterator<Authorizable> authorizables = Iterators.transform(resultRows.iterator(), new ResultRowToAuthorizable(userManager, root, type));
            return Iterators.filter(authorizables, new UniqueResultPredicate());
        } catch (ParseException e) {
            log.warn("Invalid user query: " + statement, e);
            throw new RepositoryException(e);
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

    private Iterator<Authorizable> findAuthorizables(@Nonnull String statement,
                                                     long limit,
                                                     long offset,
                                                     @Nullable AuthorizableType type) throws RepositoryException {
        try {
            QueryEngine queryEngine = root.getQueryEngine();
            Iterable<? extends ResultRow> resultRows = queryEngine.executeQuery(statement, javax.jcr.query.Query.XPATH, limit, offset, null, namePathMapper).getRows();
            Iterator<Authorizable> authorizables = Iterators.transform(resultRows.iterator(), new ResultRowToAuthorizable(userManager, root, type));
            return Iterators.filter(authorizables, new UniqueResultPredicate());
        } catch (ParseException e) {
            log.warn("Invalid user query: " + statement, e);
            throw new RepositoryException(e);
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

        }
        stmt.append(']');
        stmt.append(" order by jcr:path");

        try {
            QueryEngine queryEngine = root.getQueryEngine();
            return queryEngine.executeQuery(stmt.toString(), Query.XPATH, Long.MAX_VALUE, 0, Collections.<String, PropertyValue>emptyMap(), NamePathMapper.DEFAULT);
        } catch (ParseException e) {
            String msg = "Error while collecting effective policies.";
            log.error(msg, e.getMessage());
            throw new RepositoryException(msg, e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

            i++;
        }
        stmt.append(']');

        try {
            QueryEngine queryEngine = root.getQueryEngine();
            return queryEngine.executeQuery(stmt.toString(), Query.XPATH, Long.MAX_VALUE, 0, Collections.<String, PropertyValue>emptyMap(), NamePathMapper.DEFAULT);
        } catch (ParseException e) {
            String msg = "Error while collecting effective policies.";
            log.error(msg, e.getMessage());
            throw new RepositoryException(msg, e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.api.QueryEngine

    }

    // TODO: move to user related oak-spi that is used both by JCR usermanagement
    // and oak-level functionality.
    private static String getUserPath(ContentSession contentSession, String userID) {
        QueryEngine qe = contentSession.getQueryEngine();
        try {
            String uuid = UUID.nameUUIDFromBytes(userID.toLowerCase().getBytes("UTF-8")).toString();
            Map<String, CoreValue> bindings = Collections.singletonMap("id", contentSession.getCoreValueFactory().createValue(uuid));
            String statement = "SELECT * FROM [rep:User] WHERE [jcr:uuid] = $id";
            Result result = contentSession.getQueryEngine().executeQuery(statement, Query.JCR_SQL2, contentSession, Long.MAX_VALUE, 0, bindings, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.