Package org.odmg

Examples of org.odmg.OQLQuery.execute()


        tx.getBroker().clearCache();

        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Employee.class.getName()+" where name like $1");
        query.bind(name + "%");
        Collection result = (Collection) query.execute();
        assertEquals(6, result.size());
        for(Iterator iterator = result.iterator(); iterator.hasNext();)
        {
            Employee obj = (Employee) iterator.next();
            assertNotNull(obj.getName());
View Full Code Here


        tx.getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create("select objects from " + Executive.class.getName()+" where name like $1");
        query.bind(name + "%");
        result = (Collection) query.execute();
        assertEquals(5, result.size());
        for(Iterator iterator = result.iterator(); iterator.hasNext();)
        {
            Executive obj = (Executive) iterator.next();
            assertNotNull(obj.getName());
View Full Code Here

        tx.getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create("select objects from " + Manager.class.getName()+" where name like $1");
        query.bind(name + "%");
        result = (Collection) query.execute();
        assertEquals(3, result.size());
        for(Iterator iterator = result.iterator(); iterator.hasNext();)
        {
            Manager obj = (Manager) iterator.next();
            assertNotNull(obj.getName());
View Full Code Here

        tx.getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Manager.class.getName()+" where name like $1 and department like $2");
        query.bind(name + "%");
        query.bind("none");
        Collection result = (Collection) query.execute();
        tx.commit();
        assertEquals(1, result.size());
    }

    public void testQuery_Reference() throws Exception
View Full Code Here

        tx.getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Employee.class.getName()+" where name like $1 and address.street like $2");
        query.bind(name + "%");
        query.bind("%valley");
        Collection result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
        Employee emp = (Employee) result.iterator().next();
        assertNotNull(emp.getAddress());
View Full Code Here

        tx.getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Manager.class.getName()+" where name like $1 and address.street like $2");
        query.bind(name + "%");
        query.bind("snob allee");
        Collection result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
        Manager retManager = (Manager) result.iterator().next();
        assertNotNull(retManager);
View Full Code Here

        tx.getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Executive.class.getName()+" where name like $1 and address.street like $2");
        query.bind(name + "%");
        query.bind("snob allee");
        Collection result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
        Executive retManager = (Executive) result.iterator().next();
        assertNotNull(retManager);
View Full Code Here

        tx.getBroker().clearCache();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select objects from " + Employee.class.getName()+" where name like $1 and address.street like $2");
        query.bind(name + "%");
        query.bind("snob allee");
        Collection result = (Collection) query.execute();
        tx.commit();
        assertEquals(1, result.size());
        Employee emp = (Employee) result.iterator().next();
        assertNotNull(emp);
        assertEquals(name + "_manager_1", emp.getName());
View Full Code Here

        assertEquals(4, result.size());

        result = (Collection) queryExecutive.execute();
        assertEquals(3, result.size());

        result = (Collection) queryManager.execute();
        assertEquals(1, result.size());
    }

    public void testUpdate() throws Exception
    {
View Full Code Here

        {
            tx.begin();

            OQLQuery query = odmg.newOQLQuery();
            query.create("select x from " + Article.class.getName() + " where productGroupId = 7");
            DList results = (DList) query.execute();

            int originalSize = results.size();
            assertTrue("result count have to be > 0", originalSize > 0);

//            OJB.getLogger().debug(results);
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.