Package org.odmg

Examples of org.odmg.OQLQuery.bind()


        tx.getBroker().clearCache();
        tx.commit();

        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();
        assertEquals(1, result.size());

        query = odmg.newOQLQuery();
View Full Code Here


        tx.commit();

        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();
        assertEquals(1, result.size());

        query = odmg.newOQLQuery();
        query.create("select objects from " + Employee.class.getName()+" where name like $1");
View Full Code Here

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

        query = odmg.newOQLQuery();
        query.create("select objects from " + Employee.class.getName()+" where name like $1");
        query.bind(name + "%");
        result = (Collection) query.execute();
        assertEquals(6, result.size());

        query = odmg.newOQLQuery();
        query.create("select objects from " + Executive.class.getName()+" where name like $1");
View Full Code Here

        tx.getBroker().clearCache();
       
        OQLQuery query = odmg.newOQLQuery();
        query.create("select gourmets from " + ODMGGourmet.class.getName() +
                " where gourmetId=$1");
        query.bind(new Integer(dorisId));
        List gourmets = (List) query.execute();
        tx.commit();
        assertEquals(1, gourmets.size());
        ODMGGourmet loadedDoris = (ODMGGourmet) gourmets.get(0);
        //System.err.println(loadedDoris);
View Full Code Here

        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select gourmets from " + ODMGGourmet.class.getName() +
                " where gourmetId=$1");
        query.bind(new Integer(jamesId));
        gourmets = (List) query.execute();
        tx.commit();
        assertEquals(1, gourmets.size());
        ODMGGourmet loadedJames = (ODMGGourmet) gourmets.get(0);
        //System.err.println(loadedJames);
View Full Code Here

        tx.begin();
        // make sure all objects are retrieved freshly in subsequent transactions
        ((TransactionImpl) tx).getBroker().clearCache();
        OQLQuery qry = odmg.newOQLQuery();
        qry.create("select a from " + PersonImpl.class.getName() + " where firstname=$1");
        qry.bind(firstnameFather);
        Collection result = (Collection) qry.execute();

        assertEquals("Exactly one element in result set", 1, result.size());
        Person returnedFather = (Person) result.iterator().next();
        // should retrieve new instance, cause we clear the cache
View Full Code Here

        database.deletePersistent(returnedFather);
        tx.commit();

        qry = odmg.newOQLQuery();
        qry.create("select a from " + PersonImpl.class.getName() + " where firstname=$1");
        qry.bind(firstnameFather);
        result = (Collection) qry.execute();
        assertEquals("Exactly one element in result set", 0, result.size());

        qry = odmg.newOQLQuery();
        qry.create("select a from " + PersonImpl.class.getName() + " where firstname=$1");
View Full Code Here

        result = (Collection) qry.execute();
        assertEquals("Exactly one element in result set", 0, result.size());

        qry = odmg.newOQLQuery();
        qry.create("select a from " + PersonImpl.class.getName() + " where firstname=$1");
        qry.bind(firstnameChild_1);
        result = (Collection) qry.execute();
        // System.out.println("child: "+result.iterator().next());
        assertEquals("Exactly one element in result set", 0, result.size());
    }
View Full Code Here

        tx = odmg.newTransaction();
        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select all from " + RollbackObjectOne.class.getName() + " where name like $1");
        query.bind(name);
        List list = (List) query.execute();
        tx.commit();
        assertEquals(2,list.size());

        tx = odmg.newTransaction();
View Full Code Here

        tx = odmg.newTransaction();
        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select all from " + RollbackObjectOne.class.getName() + " where name like $1");
        query.bind(name);
        list = (List) query.execute();
        tx.commit();
        assertEquals(2,list.size());
        assertNull(((RollbackObjectOne)list.get(0)).getDescription());
        assertNull(((RollbackObjectOne)list.get(1)).getDescription());
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.