Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.Query


        setLayout(new BorderLayout());
        add(builder.getPanel(), BorderLayout.CENTER);
    }

    void initFromModel() {
        Query query = mediator.getCurrentQuery();

        if (!(query instanceof SQLTemplate)) {
            setVisible(false);
            return;
        }
View Full Code Here


        return (key.equals(DEFAULT_LABEL)) ? query.getDefaultTemplate() : query
                .getCustomTemplate(key);
    }

    SQLTemplate getQuery() {
        Query query = mediator.getCurrentQuery();
        return (query instanceof SQLTemplate) ? (SQLTemplate) query : null;
    }
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

    public void testPerformQueryObjectIDInjection() throws Exception {
        createTestData("testOnSelectQueryObjectIDInjection");

        DataContext context = createDataContext();

        Query query = new SelectQuery("MtTable1");
        QueryResponse response = new ClientServerChannel(context).onQuery(null, query);

        assertNotNull(response);

        List results = response.firstList();
View Full Code Here

        createTestData("testOnSelectQueryValuePropagation", parameters);

        DataContext context = createDataContext();

        Query query = new SelectQuery("MtTable3");
        QueryResponse response = new ClientServerChannel(context).onQuery(null, query);

        assertNotNull(response);

        List results = response.firstList();
View Full Code Here

        // fact that Query inherits from AbstractQuery.
        SelectQuery query = new SelectQuery(ClientMtTable1.class);

        // must pass through the serialization pipe before running query as
        // HessianSerializer has needed preprocessing hooks...
        Query preprocessedQuery = (Query) HessianUtil.cloneViaClientServerSerialization(
                query,
                context.getEntityResolver());

        QueryResponse response = new ClientServerChannel(context).onQuery(
                null,
View Full Code Here

        q.addOrdering(ClientMtTable1.GLOBAL_ATTRIBUTE1_PROPERTY, true);
        q.addPrefetch(ClientMtTable1.TABLE2ARRAY_PROPERTY);

        // must pass through the serialization pipe before running query as
        // HessianSerializer has needed preprocessing hooks...
        Query preprocessedQuery = (Query) HessianUtil.cloneViaClientServerSerialization(
                q,
                context.getEntityResolver());

        List results = channel.onQuery(null, preprocessedQuery).firstList();
View Full Code Here

        q.addOrdering(ClientMtTable1.GLOBAL_ATTRIBUTE1_PROPERTY, true);
        q.addPrefetch(ClientMtTable1.TABLE2ARRAY_PROPERTY);

        // must pass through the serialization pipe before running query as
        // HessianSerializer has needed preprocessing hooks...
        Query preprocessedQuery = (Query) HessianUtil.cloneViaClientServerSerialization(
                q,
                context.getEntityResolver());

        List results = channel.onQuery(null, preprocessedQuery).firstList();
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

            OperationObserver resultConsumer) {

        // stick preset results to the consumer
        Iterator it = queries.iterator();
        while (it.hasNext()) {
            Query query = (Query) it.next();
            resultConsumer.nextRows(query, (List) results.get(query));
        }
    }
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.