Package org.apache.cayenne.query

Examples of org.apache.cayenne.query.AbstractQuery


                dataMap.addQuery(query);
                QueryType.fireQueryEvent(this, mediator, dataMap, query);
            }
            else if (content instanceof Query) {
                // paste Query to DataMap
                AbstractQuery query = (AbstractQuery) content;

                query.setName(getFreeName(new QueryNameChecker(domain), query.getName()));
                query.setDataMap(dataMap);

                dataMap.addQuery(query);
                QueryType.fireQueryEvent(this, mediator, dataMap, query);
            }
            else if (content instanceof Procedure) {
View Full Code Here


        assertSame(e, map.getDbEntity(e.getName()));
        assertSame(map, e.getDataMap());
    }

    public void testAddQuery() {
        AbstractQuery q = new MockAbstractQuery("a");
        DataMap map = new DataMap();
        map.addQuery(q);
        assertSame(q, map.getQuery("a"));
    }
View Full Code Here

        map.addQuery(q);
        assertSame(q, map.getQuery("a"));
    }

    public void testRemoveQuery() {
        AbstractQuery q = new MockAbstractQuery("a");

        DataMap map = new DataMap();
        map.addQuery(q);
        assertSame(q, map.getQuery("a"));
        map.removeQuery("a");
View Full Code Here

        map.removeQuery("a");
        assertNull(map.getQuery("a"));
    }

    public void testGetQueryMap() {
        AbstractQuery q = new MockAbstractQuery("a");
        DataMap map = new DataMap();
        map.addQuery(q);
        Map<String, Query> queries = map.getQueryMap();
        assertEquals(1, queries.size());
        assertSame(q, queries.get("a"));
View Full Code Here

        Map queryPlist = helper.queryPListMap(entity.getName(), queryName);
        if (queryPlist == null) {
            return null;
        }
       
        AbstractQuery query;
        if (queryPlist.containsKey("hints")) { // just a predefined SQL query
            query = new EOSQLQuery(entity, queryPlist);
        } else {
            query = new EOQuery(entity, queryPlist);
        }
        query.setName(entity.qualifiedQueryName(queryName));
        dataMap.addQuery(query);
       
        return query;
    }
View Full Code Here

TOP

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

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.