Package org.modeshape.jcr.query.model

Examples of org.modeshape.jcr.query.model.Query


     *
     * @return the resulting query command; never null
     * @see #clear()
     */
    public QueryCommand query() {
        QueryCommand result = new Query(source, constraint, orderings, columns, limit, distinct);
        if (this.firstQuery != null) {
            // EXCEPT has a higher precedence than INTERSECT or UNION, so if the first query is
            // an INTERSECT or UNION SetQuery, the result should be applied to the RHS of the previous set ...
            if (firstQuery instanceof SetQuery && firstQuerySetOperation == Operation.EXCEPT) {
                SetQuery setQuery = (SetQuery)firstQuery;
View Full Code Here


                }
            }
            orderByBuilder.end();
        }
        // Try building this query, because we need to check the # of columns selected and the # of sources ...
        Query query = (Query)builder.query();
        if (query.columns().isEmpty() && query.source() instanceof AllNodes) {
            // This is basically 'SELECT * FROM __ALLNODES__", which means that no type was explicitly specified and
            // nothing was selected from that type. According to JCR 1.0 Section 6.6.3.1, this equates to
            // 'SELECT * FROM [nt:base]', and since there is just one property on nt:base (but many on __ALLNODES__)
            // this really equates to 'SELECT [jcr:primaryType] FROM __ALLNODES__'.
            builder.select("jcr:primaryType");
View Full Code Here

     *      org.modeshape.jcr.query.model.TypeSystem)
     */
    @Override
    protected Query parseQuery( TokenStream tokens,
                                TypeSystem typeSystem ) {
        Query query = super.parseQuery(tokens, typeSystem);
        // See if we have to rewrite the JCR-SQL-style join ...
        if (query.source() instanceof JoinableSources) {
            JoinableSources joinableSources = (JoinableSources)query.source();
            // Rewrite the joins ...
            Source newSource = rewrite(joinableSources);
            query = new Query(newSource, query.constraint(), query.orderings(), query.columns(), query.getLimits(),
                              query.isDistinct());
        }
        return query;
    }
View Full Code Here

                           Constraint constraint,
                           List<? extends Ordering> orderings,
                           List<? extends Column> columns,
                           Limit limit,
                           boolean distinct ) {
        return new Query(source, constraint, orderings, columns, limit, distinct);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.model.Query

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.