Package org.apache.cayenne.util

Examples of org.apache.cayenne.util.ListResponse


                if (oidQuery.isFetchAllowed()) {

                    runQueryInTransaction();
                }
                else {
                    response = new ListResponse();
                }
            }
            else {
                response = new ListResponse(row);
            }

            return DONE;
        }
View Full Code Here


            List cachedResults = queryCache.get(metadata, factory);

            // response may already be initialized by the factory above ... it is null if
            // there was a preexisting cache entry
            if (response == null) {
                response = new ListResponse(cachedResults);
            }

            if (cachedResults instanceof ListWithPrefetches) {
                this.prefetchResultsByPath = ((ListWithPrefetches) cachedResults)
                        .getPrefetchResultsByPath();
View Full Code Here

                if (response instanceof GenericResponse) {
                    ((GenericResponse) response).replaceResult(mainRows, objects);
                }
                else if (response instanceof ListResponse) {
                    this.response = new ListResponse(objects);
                }
                else {
                    throw new IllegalStateException("Unknown response object: "
                            + this.response);
                }
View Full Code Here

            if (response instanceof GenericResponse) {
                ((GenericResponse) response).replaceResult(mainRows, objects);
            }
            else if (response instanceof ListResponse) {
                this.response = new ListResponse(objects);
            }
            else {
                throw new IllegalStateException("Unknown response object: "
                        + this.response);
            }
View Full Code Here

    public void testOnQuery_Blocking() {

        DataDomain domain = runtime.getDataDomain();

        final QueryResponse r1 = new ListResponse();
        final QueryResponse r2 = new ListResponse();

        DataChannelFilter f1 = new MockDataChannelFilter() {

            @Override
            public QueryResponse onQuery(
View Full Code Here

            int startIndex = serverMetadata.getFetchOffset();
            int endIndex = startIndex + serverMetadata.getFetchLimit();

            // send back just one page... query sender will figure out where it fits in
            // the incremental list
            this.response = new ListResponse(new ArrayList<Object>(cachedList.subList(
                    startIndex,
                    endIndex)));

            return DONE;
        }
View Full Code Here

        return response;
    }

    private boolean interceptDataDomainQuery() {
        if (query instanceof DataDomainQuery) {
            response = new ListResponse(domain);
            return DONE;
        }

        return !DONE;
    }
View Full Code Here

            // special handling of temp ids... Return an empty list immediately so that
            // upstream code could throw FaultFailureException, etc. Don't attempt to
            // translate and run the query. See for instance CAY-1651
            if (oid.isTemporary() && !oid.isReplacementIdAttached()) {
                response = new ListResponse();
                return DONE;
            }

            DataRow row = null;

            if (cache != null && !oidQuery.isFetchMandatory()) {
                row = cache.getCachedSnapshot(oidQuery.getObjectId());
            }

            // refresh is forced or not found in cache
            if (row == null) {

                if (oidQuery.isFetchAllowed()) {

                    runQueryInTransaction();
                }
                else {
                    response = new ListResponse();
                }
            }
            else {
                response = new ListResponse(row);
            }

            return DONE;
        }
View Full Code Here

            List cachedResults = queryCache.get(metadata, factory);

            // response may already be initialized by the factory above ... it is null if
            // there was a preexisting cache entry
            if (response == null) {
                response = new ListResponse(cachedResults);
            }

            if (cachedResults instanceof ListWithPrefetches) {
                this.prefetchResultsByPath = ((ListWithPrefetches) cachedResults)
                        .getPrefetchResultsByPath();
View Full Code Here

        protected void updateResponse(List sourceObjects, List targetObjects) {
            if (response instanceof GenericResponse) {
                ((GenericResponse) response).replaceResult(sourceObjects, targetObjects);
            }
            else if (response instanceof ListResponse) {
                response = new ListResponse(targetObjects);
            }
            else {
                throw new IllegalStateException("Unknown response object: " + response);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.util.ListResponse

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.