Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.Query


        if (sort) {
            queries = Util.sortedIterator(queries, ProjectTraversal.queryComparator);
        }

        while (queries.hasNext()) {
            Query query = (Query) queries.next();
            ProjectPath queryPath = path.appendToPath(query);
            handler.projectNode(queryPath);
        }
    }
View Full Code Here


        if (sort) {
            queries = Util.sortedIterator(queries, ProjectTraversal.queryComparator);
        }

        while (queries.hasNext()) {
            Query query = (Query) queries.next();
            ProjectPath queryPath = path.appendToPath(query);
            handler.projectNode(queryPath);
        }
    }
View Full Code Here

        rootNode.traverse(this);
    }

    protected Expression extractQualifier() {
        Query q = queryAssembler.getQuery();

        Expression qualifier = ((QualifiedQuery) q).getQualifier();

        // append Entity qualifiers, taking inheritance into account
        ObjEntity entity = getObjEntity();
View Full Code Here

            }

            // 3. refresh query - this shouldn't normally happen as child datacontext
            // usually does a cascading refresh
            if (refreshQuery.getQuery() != null) {
                Query cachedQuery = refreshQuery.getQuery();

                String cacheKey = cachedQuery
                        .getMetaData(context.getEntityResolver())
                        .getCacheKey();
                context.getQueryCache().remove(cacheKey);

                this.response = domain.onQuery(context, cachedQuery);
View Full Code Here

     * Returns a named query associated with this DataMap.
     *
     * @since 1.1
     */
    public Query getQuery(String queryName) {
        Query query = queryMap.get(queryName);
        if (query != null) {
            return query;
        }

        return namespace != null ? namespace.getQuery(queryName) : null;
View Full Code Here

    /**
     * Returns a named query or null if no query exists for a given name.
     */
    public synchronized Query lookupQuery(String name) {
        Query result = queryCache.get(name);

        if (result == null) {
            // reconstruct cache just in case some of the datamaps
            // have changed and now contain the required information
            constructCache();
View Full Code Here

        if (sort) {
            queries = Util.sortedIterator(queries, ProjectTraversal.queryComparator);
        }

        while (queries.hasNext()) {
            Query query = (Query) queries.next();
            ProjectPath queryPath = path.appendToPath(query);
            handler.projectNode(queryPath);
        }
    }
View Full Code Here

        this.cacheKey = metadata.getCacheKey();
        if (cacheKey == null) {
            cacheKey = generateCacheKey();
        }

        Query query = paginatedQuery;
        if (metadata.getCacheKey() == null) {

            // there are some serious pagination optimizations for SelectQuery on the
            // server-side, so use a special wrapper that is itself a subclass of
            // SelectQuery
View Full Code Here

                return !DONE;
            }

            // 3. refresh query - have to do it eagerly to refresh the objects involved
            if (refreshQuery.getQuery() != null) {
                Query cachedQuery = refreshQuery.getQuery();

                String cacheKey = cachedQuery
                        .getMetaData(context.getEntityResolver())
                        .getCacheKey();
                context.getQueryCache().remove(cacheKey);

                this.response = context.performGenericQuery(cachedQuery);
View Full Code Here

     * Returns a named query associated with this DataMap.
     *
     * @since 1.1
     */
    public Query getQuery(String queryName) {
        Query query = queryMap.get(queryName);
        if (query != null) {
            return query;
        }

        return namespace != null ? namespace.getQuery(queryName) : null;
View Full Code Here

TOP

Related Classes of org.apache.cayenne.query.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.