Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.Query


            SelectQuery select = new SelectQuery(entity);
            select.setFetchingDataRows(true);

            // delegate is allowed to substitute query
            Query query = (delegate != null) ? delegate.willPortEntity(
                    this,
                    entity,
                    select) : select;

            sourceNode.performQueries(Collections.singletonList(query), observer);
View Full Code Here


    public boolean isIteratedResult() {
        return callback.isIteratedResult();
    }

    Query queryForExecutedQuery(Query executedQuery) {
        Query q = null;

        if (queriesByExecutedQueries != null) {
            q = queriesByExecutedQueries.get(executedQuery);
        }
View Full Code Here

        if (id.isTemporary()) {
            return null;
        }

        // skip context cache lookup, go directly to its channel
        Query query = new ObjectIdQuery((ObjectId) nodeId);
        QueryResponse response = context.getChannel().onQuery(context, query);
        List objects = response.firstList();

        if (objects.size() == 0) {
            throw new CayenneRuntimeException("No object for ID exists: " + nodeId);
View Full Code Here

                // cascade
                return !DONE;
            }

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

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

                this.response = context.performGenericQuery(cachedQuery);
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

        }
        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

     * @since 3.0
     */
    @Override
    protected void doAppendPart() throws IOException {

        Query q = queryAssembler.getQuery();

        // only select queries can have ordering...
        if (q == null || !(q instanceof SelectQuery)) {
            return;
        }
View Full Code Here

            List cachedList = channel.getQueryCache().get(serverMetadata);
            if (cachedList == null) {

                // attempt to refetch... respawn the action...

                Query originatingQuery = serverMetadata.getOrginatingQuery();
                if (originatingQuery != null) {

                    ClientServerChannelQueryAction subaction = new ClientServerChannelQueryAction(
                            channel,
                            originatingQuery);
View Full Code Here

     * Returns stored EOQuery.
     *
     * @since 1.1
     */
    public EOQuery getEOQuery(String queryName) {
        Query query = getDataMap().getQuery(qualifiedQueryName(queryName));
        if (query instanceof EOQuery) {
            return (EOQuery) query;
        }

        return null;
View Full Code Here

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

        Query query = paginatedQuery;

        // always wrap a query in a Incremental*Query, to ensure cache key is
        // client-generated (e.g. see CAY-1003 - client and server can be in different
        // timezones, so the key can be messed up)

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.