Package javax.jcr.query

Examples of javax.jcr.query.InvalidQueryException


    public Query getQuery( Node node ) throws InvalidQueryException, RepositoryException {
        assert node instanceof AbstractJcrNode;

        JcrNodeType nodeType = (JcrNodeType)node.getPrimaryNodeType();
        if (!nodeType.getInternalName().equals(JcrNtLexicon.QUERY)) {
            throw new InvalidQueryException(JcrI18n.notStoredQuery.text());
        }

        // These are both mandatory properties for nodes of nt:query
        NamespaceRegistry registry = session.getExecutionContext().getNamespaceRegistry();
        String statement = node.getProperty(JcrLexicon.STATEMENT.getString(registry)).getString();
View Full Code Here


        this.session = session;
        this.node = node;
        this.handler = handler;

        if (!((ExtendedNode)node).isNodeType(Constants.NT_QUERY)){
            throw new InvalidQueryException("node is not of type nt:query");
        }
        statement = node.getProperty("jcr:statement").getString();
        language = node.getProperty("jcr:language").getString();
        query = handler.createExecutableQuery(session, itemMgr, statement, language);
        setInitialized();
View Full Code Here

        } else if (ex instanceof ConstraintViolationException) {
            return new ConstraintViolationException(ex.getMessage());
        } else if (ex instanceof InvalidItemStateException) {
            return new InvalidItemStateException(ex.getMessage());
        } else if (ex instanceof InvalidQueryException) {
            return new InvalidQueryException(ex.getMessage());
        } else if (ex instanceof InvalidSerializedDataException) {
            return new InvalidSerializedDataException(ex.getMessage());
        } else if (ex instanceof ItemExistsException) {
            return new ItemExistsException(ex.getMessage());
        } else if (ex instanceof ItemNotFoundException) {
View Full Code Here

    }

    @Override
    public QueryImpl createQuery(String statement, String language) throws RepositoryException {
        if (!supportedQueryLanguages.contains(language)) {
            throw new InvalidQueryException("The specified language is not supported: " + language);
        }
        return new QueryImpl(this, statement, language, sessionContext);
    }
View Full Code Here

    }

    @Override
    public Query getQuery(Node node) throws RepositoryException {
        if (!node.isNodeType(JcrConstants.NT_QUERY)) {
            throw new InvalidQueryException("Not an nt:query node: " + node.getPath());
        }
        String statement = node.getProperty(JcrConstants.JCR_STATEMENT).getString();
        String language = node.getProperty(JcrConstants.JCR_LANGUAGE).getString();
        QueryImpl query = createQuery(statement, language);
        query.setStoredQueryPath(node.getPath());
View Full Code Here

     */
    public List<String> parse(String statement, String language) throws InvalidQueryException {
        try {
            return queryEngine.getBindVariableNames(statement, language);
        } catch (ParseException e) {
            throw new InvalidQueryException(e);
        }
    }
View Full Code Here

            Map<String, PropertyValue> bindMap = convertMap(bindVariableMap);
            Result r = queryEngine.executeQuery(statement, language, limit, offset,
                    bindMap, sessionContext);
            return new QueryResultImpl(sessionContext, r);
        } catch (IllegalArgumentException e) {
            throw new InvalidQueryException(e);
        } catch (ParseException e) {
            throw new InvalidQueryException(e);
        }
    }
View Full Code Here

    public List<String> parse(String statement, String language) throws InvalidQueryException {
        try {
            return queryEngine.getBindVariableNames(statement, language);
        } catch (ParseException e) {
            throw new InvalidQueryException(e);
        }
    }
View Full Code Here

        try {
            HashMap<String, CoreValue> bindMap = convertMap(bindVariableMap);
            Result r = queryEngine.executeQuery(statement, language, bindMap);
            return new QueryResultImpl(r, sessionContext.getValueFactory());
        } catch (ParseException e) {
            throw new InvalidQueryException(e);
        }
    }
View Full Code Here

    }

    @Override
    public QueryImpl createQuery(String statement, String language) throws RepositoryException {
        if (!supportedQueryLanguages.contains(language)) {
            throw new InvalidQueryException("The specified language is not supported: " + language);
        }
        return new QueryImpl(this, statement, language, sessionContext);
    }
View Full Code Here

TOP

Related Classes of javax.jcr.query.InvalidQueryException

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.