Package org.odmg

Examples of org.odmg.OQLQuery.bind()


        queryEmployee.create("select objects from " + Employee.class.getName()+" where name like $1");
        queryEmployee.bind(name);

        OQLQuery queryExecutive = odmg.newOQLQuery();
        queryExecutive.create("select objects from " + Executive.class.getName()+" where name like $1");
        queryExecutive.bind(name);

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


        queryExecutive.create("select objects from " + Executive.class.getName()+" where name like $1");
        queryExecutive.bind(name);

        OQLQuery queryManager = odmg.newOQLQuery();
        queryManager.create("select objects from " + Manager.class.getName()+" where name like $1");
        queryManager.bind(name);

        Collection result = (Collection) queryEmployee.execute();
        assertEquals(4, result.size());

        result = (Collection) queryExecutive.execute();
View Full Code Here

        {
            tx.begin();

            OQLQuery query = odmg.newOQLQuery();
            query.create("select anArticle from " + Article.class.getName() + " where articleId = $678");
            query.bind(new Integer(30));

            List results = (List) query.execute();

            Article a = (Article) results.get(0);
View Full Code Here

            tx.begin();

            // retrieve an Article
            OQLQuery query = odmg.newOQLQuery();
            query.create("select anArticle from " + Article.class.getName() + " where articleId = $678");
            query.bind(new Integer(30));
            List results = (List) query.execute();
            Article a = (Article) results.get(0);

            // manipulate metadata
            broker = ((TransactionImpl) tx).getBroker();
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
View Full Code Here

        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.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
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

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.