Package org.odmg

Examples of org.odmg.OQLQuery.create()


        TransactionExt tx = (TransactionExt) odmg.newTransaction();
        tx.begin();
        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());
View Full Code Here


        assertEquals(name, newM1.getName());

        assertEquals(2, newM1.getExecutives().size());

        OQLQuery queryEmployee = odmg.newOQLQuery();
        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);
View Full Code Here

        OQLQuery queryEmployee = odmg.newOQLQuery();
        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

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

        Collection result = (Collection) queryEmployee.execute();
        assertEquals(4, result.size());
View Full Code Here

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

        try
        {
            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

        //perform transaction
        try
        {
            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
            query.create("select aLotOfArticles from " + Article.class.getName() + " where productGroupId = 4");

            DCollection results = (DCollection) query.execute();
            results = results.query("price > 35");

            // now perform control query
View Full Code Here

            DCollection results = (DCollection) query.execute();
            results = results.query("price > 35");

            // now perform control query
            query = odmg.newOQLQuery();
            query.create(
                    "select aLotOfArticles from "
                    + Article.class.getName()
                    + " where productGroupId = 4 and price  > 35");

            DCollection check = (DCollection) query.execute();
View Full Code Here

            Transaction tx = odmg.newTransaction();
            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
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

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.