Package javax.jcr.query

Examples of javax.jcr.query.InvalidQueryException


            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


    }

    @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, sessionContext);
        } 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

                                    operator,
                                    evaluator.getValue(operand, row), value);
                        }
                    };
                } catch (ValueFormatException e) {
                    throw new InvalidQueryException(e);
                }
            } else {
                Query cq = getComparisonQuery(
                        left, transform.transform, operator, right, selectorMap);
                query.subQuery.add(cq, MUST);
View Full Code Here

                || type == PropertyType.DECIMAL
                || type == PropertyType.LONG
                || type == PropertyType.BOOLEAN
                || type == PropertyType.REFERENCE
                || type == PropertyType.WEAKREFERENCE) {
            throw new InvalidQueryException("Invalid name value: " + string);
        }

        try {
            Name name = session.getQName(string);
            Term uri = new Term(NAMESPACE_URI, name.getNamespaceURI());
            Term local = new Term(LOCAL_NAME, name.getLocalName());

            BooleanQuery query = new BooleanQuery();
            query.add(new JackrabbitTermQuery(uri), MUST);
            query.add(new JackrabbitTermQuery(local), MUST);
            return query;
        } catch (IllegalNameException e) {
            throw new InvalidQueryException("Illegal name: " + string, e);
        }
    }
View Full Code Here

        String sub = statement.substring(start, i);
        BigDecimal bd;
        try {
            bd = new BigDecimal(sub);
        } catch (NumberFormatException e) {
            throw new InvalidQueryException("Data conversion error converting " + sub + " to BigDecimal: " + e);
        }
        checkLiterals(false);

        currentValue = valueFactory.createValue(bd);
        currentTokenType = VALUE;
View Full Code Here

        int index = Math.min(parseIndex, statement.length() - 1);
        String query = statement.substring(0, index) + "(*)" + statement.substring(index).trim();
        if (expected != null) {
            query += "; expected: " + expected;
        }
        return new InvalidQueryException("Query:\n" + query);
    }
View Full Code Here

                               String language,
                               AbstractJcrNode storedNode ) throws InvalidQueryException {
        if (Query.XPATH.equals(language)) {
            return new XPathQuery(this.session, statement, storedNode);
        }
        throw new InvalidQueryException(JcrI18n.invalidQueryLanguage.text(language, Arrays.asList(getSupportedQueryLanguages())));

    }
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.