Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.PrefetchSelectQuery


    public void nextDataRows(Query query, List dataRows) {

        // exclude prefetched rows in the main result
        if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery) {
            PrefetchSelectQuery prefetchQuery = (PrefetchSelectQuery) query;
            prefetchResultsByPath.put(prefetchQuery.getPrefetchPath(), dataRows);
        }
        else {
            fullResponse.addResultList(dataRows);
        }
    }
View Full Code Here


    public void nextRows(Query query, List<?> dataRows) {

        // exclude prefetched rows in the main result
        if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery) {
            PrefetchSelectQuery prefetchQuery = (PrefetchSelectQuery) query;
            prefetchResultsByPath.put(prefetchQuery.getPrefetchPath(), dataRows);
        } else {
            fullResponse.addResultList(dataRows);
        }
    }
View Full Code Here

    public void nextRows(Query query, List<?> dataRows) {

        // exclude prefetched rows in the main result
        if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery) {
            PrefetchSelectQuery prefetchQuery = (PrefetchSelectQuery) query;
            prefetchResultsByPath.put(prefetchQuery.getPrefetchPath(), dataRows);
        }
        else {
            fullResponse.addResultList(dataRows);
        }
    }
View Full Code Here

    public void nextDataRows(Query query, List dataRows) {

        // exclude prefetched rows in the main result
        if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery) {
            PrefetchSelectQuery prefetchQuery = (PrefetchSelectQuery) query;
            prefetchResultsByPath.put(prefetchQuery.getPrefetchPath(), dataRows);
        }
        else {
            fullResponse.addResultList(dataRows);
        }
    }
View Full Code Here

    public void nextRows(Query query, List<?> dataRows) {

        // exclude prefetched rows in the main result
        if (prefetchResultsByPath != null && query instanceof PrefetchSelectQuery) {
            PrefetchSelectQuery prefetchQuery = (PrefetchSelectQuery) query;
            prefetchResultsByPath.put(prefetchQuery.getPrefetchPath(), dataRows);
        }
        else {
            fullResponse.addResultList(dataRows);
        }
    }
View Full Code Here

                    .getParentDataDomain()
                    .getMaxIdQualifierSize();

            List<PrefetchSelectQuery> queries = new ArrayList<PrefetchSelectQuery>();
            int qualifiersCount = 0;
            PrefetchSelectQuery currentQuery = null;

            for (Object dataRow : parentDataRows) {
                Expression allJoinsQualifier = null;
                List<DbJoin> joins = lastDbRelationship.getJoins();

                // handling too big qualifiers
                if (currentQuery == null
                        || (maxIdQualifierSize > 0 && qualifiersCount + joins.size() > maxIdQualifierSize)) {
                    currentQuery = new PrefetchSelectQuery(node.getPath(), relationship);
                    queries.add(currentQuery);
                    qualifiersCount = 0;
                }

                for (DbJoin join : joins) {

                    Object targetValue = ((DataRow) dataRow).get(join.getSourceName());
                    Expression joinQualifier = ExpressionFactory.matchDbExp(pathPrefix
                            + join.getTargetName(), targetValue);
                    if (allJoinsQualifier == null) {
                        allJoinsQualifier = joinQualifier;
                    }
                    else {
                        allJoinsQualifier = allJoinsQualifier.andExp(joinQualifier);
                    }
                }

                currentQuery.orQualifier(allJoinsQualifier);
                qualifiersCount += joins.size();
            }

            PrefetchTreeNode jointSubtree = node.cloneJointSubtree();
View Full Code Here

TOP

Related Classes of org.apache.cayenne.query.PrefetchSelectQuery

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.