Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.SQLAction


        bindings.put("id", new Long(33005l));
        template.setParameters(bindings);

        // must ensure the right SQLTemplateAction is created
        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction plan = adapter.getAction(template, getNode());
        assertTrue(plan instanceof SQLTemplateAction);

        MockOperationObserver observer = new MockOperationObserver();
        Connection c = getConnection();

        try {
            plan.performAction(c, observer);
        }
        finally {
            c.close();
        }
View Full Code Here


        Map bindings = new HashMap();
        bindings.put("id", new Integer(33006));
        template.setParameters(bindings);

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction plan = adapter.getAction(template, getNode());

        MockOperationObserver observer = new MockOperationObserver();
        Connection c = getConnection();

        try {
            plan.performAction(c, observer);
        }
        finally {
            c.close();
        }
View Full Code Here

        Map bindings = new HashMap();
        bindings.put("id", new Integer(33006));
        template.setParameters(bindings);

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction plan = adapter.getAction(template, getNode());

        MockOperationObserver observer = new MockOperationObserver();
        Connection c = getConnection();

        try {
            plan.performAction(c, observer);
        }
        finally {
            c.close();
        }
View Full Code Here

        Map bindings = new HashMap();
        bindings.put("id", new Integer(33006));
        template.setParameters(bindings);

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction plan = adapter.getAction(template, getNode());

        MockOperationObserver observer = new MockOperationObserver();
        Connection c = getConnection();

        try {
            plan.performAction(c, observer);
        }
        finally {
            c.close();
        }
View Full Code Here

        bindings.put("name", "a1");
        bindings.put("dob", new Date(System.currentTimeMillis()));
        template.setParameters(bindings);

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction action = adapter.getAction(template, getNode());

        Connection c = getConnection();
        try {
            MockOperationObserver observer = new MockOperationObserver();
            action.performAction(c, observer);

            int[] batches = observer.countsForQuery(template);
            assertNotNull(batches);
            assertEquals(1, batches.length);
            assertEquals(1, batches[0]);
View Full Code Here

        SQLTemplate template = new SQLTemplate(
                Object.class,
                "delete from ARTIST where ARTIST_NAME like 'a%'");

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction action = adapter.getAction(template, getNode());

        Connection c = getConnection();
        try {
            MockOperationObserver observer = new MockOperationObserver();
            action.performAction(c, observer);

            int[] batches = observer.countsForQuery(template);
            assertNotNull(batches);
            assertEquals(1, batches.length);
            assertEquals(DataContextCase.artistCount, batches[0]);
View Full Code Here

        template.setParameters(new Map[] {
                bindings1, bindings2
        });

        DbAdapter adapter = getAccessStackAdapter().getAdapter();
        SQLAction genericAction = adapter.getAction(template, getNode());
        assertTrue(genericAction instanceof SQLTemplateAction);
        SQLTemplateAction action = (SQLTemplateAction) genericAction;

        assertSame(getAccessStackAdapter().getAdapter(), action.getAdapter());
        assertSame(template, action.getQuery());
View Full Code Here

        // remember root query ... it will be used to map the results, even if SQLAction
        // uses query substitute...
        this.currentQuery = query;

        SQLAction action = node.getAdapter().getAction(query, node);
        action.performAction(connection, this);
    }
View Full Code Here

        // remember root query ... it will be used to map the results, even if SQLAction
        // uses query substitute...
        this.currentQuery = query;

        SQLAction action = node.getAdapter().getAction(query, node);
        action.performAction(connection, this);
    }
View Full Code Here

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

        SQLAction action = node.getAdapter().getAction(originalQuery, node);
        action.performAction(connection, wrapper);
    }
View Full Code Here

TOP

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

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.