Examples of firstList()


Examples of org.apache.cayenne.QueryResponse.firstList()

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

        assertNotNull(response);

        List results = response.firstList();

        assertNotNull(results);
        assertEquals(1, results.size());

        Object result = results.get(0);
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

                null,
                preprocessedQuery);

        assertNotNull(response);

        List results = response.firstList();

        assertNotNull(results);
        assertEquals(1, results.size());

        Object result = results.get(0);
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        // select directly from the channel, bypassing the context. Otherwise our query
        // wrapper can be intercepted incorrectly
        QueryResponse response = context.getChannel().onQuery(context, query);

        List firstPage = response.firstList();

        // sanity check
        if (firstPage.size() > pageSize) {
            throw new IllegalArgumentException("Returned page size ("
                    + firstPage.size()
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        // select directly from the channel, bypassing the context. Otherwise our query
        // wrapper can be intercepted incorrectly
        QueryResponse response = context.getChannel().onQuery(context, query);

        List firstPage = response.firstList();

        // sanity check
        if (firstPage.size() > pageSize) {
            throw new IllegalArgumentException("Returned page size ("
                    + firstPage.size()
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        ObjectIdQuery query = new ObjectIdQuery(
                object.getObjectId(),
                true,
                ObjectIdQuery.CACHE);
        QueryResponse response = context.getChannel().onQuery(null, query);
        List result = response.firstList();
        if (result == null || result.size() == 0) {
            return null;
        }

        DataRow snapshot = (DataRow) result.get(0);
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        e1Helper.insert(3).insert(4);

        StringIdQuery query = new StringIdQuery("E1:3", "E1:4", "E1:5");
        QueryResponse response = runtime.newContext().performGenericQuery(query);
        assertEquals(1, response.size());
        assertEquals(2, response.firstList().size());

        Set<Number> ids = new HashSet<Number>();

        DataRow r1 = (DataRow) response.firstList().get(0);
        ids.add((Number) r1.get("ID"));
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        assertEquals(1, response.size());
        assertEquals(2, response.firstList().size());

        Set<Number> ids = new HashSet<Number>();

        DataRow r1 = (DataRow) response.firstList().get(0);
        ids.add((Number) r1.get("ID"));

        DataRow r2 = (DataRow) response.firstList().get(1);
        ids.add((Number) r2.get("ID"));
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        Set<Number> ids = new HashSet<Number>();

        DataRow r1 = (DataRow) response.firstList().get(0);
        ids.add((Number) r1.get("ID"));

        DataRow r2 = (DataRow) response.firstList().get(1);
        ids.add((Number) r2.get("ID"));

        assertTrue(ids.contains(3l));
        assertTrue(ids.contains(4l));
    }
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        }

        // 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);
        }
        else if (objects.size() > 1) {
View Full Code Here

Examples of org.apache.cayenne.QueryResponse.firstList()

        ObjectIdQuery query = new ObjectIdQuery(
                object.getObjectId(),
                true,
                ObjectIdQuery.CACHE);
        QueryResponse response = context.getChannel().onQuery(null, query);
        List<?> result = response.firstList();
        if (result == null || result.size() == 0) {
            return null;
        }

        DataRow snapshot = (DataRow) result.get(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.