Package org.odmg

Examples of org.odmg.OQLQuery.create()


        database.deletePersistent(returnedFather.getChildren()[1]);

        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();
View Full Code Here


        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");
        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.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();
View Full Code Here

        database.deletePersistent(returnedFather.getChildren()[1]);
        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();
View Full Code Here

        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");
        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

    protected int getDBObjectCountViaOqlQueryUseNewTransaction(Implementation odmg, Class target) throws Exception
    {
        Transaction tx = odmg.newTransaction();
        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select allProjects from " + target.getName());
        List list = (List) query.execute();
        tx.commit();
        return list.size();
    }
View Full Code Here

    protected int getDBObjectCountViaOqlQueryUseNewTransaction(Implementation ojb, Class target) throws Exception
    {
        Transaction tx = ojb.newTransaction();
        tx.begin();
        OQLQuery query = ojb.newOQLQuery();
        query.create("select allProjects from " + target.getName());
        List list = (List) query.execute();
        tx.commit();
        return list.size();
    }
View Full Code Here

    }

    protected int getDBObjectCountViaOqlQuery(Implementation ojb, Class target) throws Exception
    {
        OQLQuery query = ojb.newOQLQuery();
        query.create("select allObjects from " + target.getName());
        List list = (List) query.execute();
        return list.size();
    }

    protected List getAllObjects(Implementation ojb, Class target) throws Exception
View Full Code Here

    }

    protected List getAllObjects(Implementation ojb, Class target) throws Exception
    {
        OQLQuery query = ojb.newOQLQuery();
        query.create("select allObjects from " + target.getName());
        List list = (List) query.execute();
        return list;
    }
}
View Full Code Here

        tx.begin();
        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());
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.