Package org.apache.ojb.odmg.oql

Examples of org.apache.ojb.odmg.oql.EnhancedOQLQuery.create()


            // get from the database via OQLQuery Iterator
            tx = _kit.getTransaction(_conn);
            _conn.invalidate(oid);
            tx.begin();
            oql = _conn.newOQLQuery();
            oql.create("select a from " + Article.class.getName()
                + " where articleId=$1 and articleName=$2");
            oql.bind(new Integer(77777));
            oql.bind("335");
            it = _conn.getIteratorByOQLQuery(oql);
            if (it.hasNext())
View Full Code Here


            example.setStock(333);
            example.setArticleName("333");
            conn1.makePersistent(example);

            EnhancedOQLQuery query = conn2.newOQLQuery();
            query.create("select obj from " + Article.class.getName()
                         + " where " + "articleId = " + example.getArticleId());
            Article same = (Article) conn2.getIteratorByOQLQuery(query).next();
            Assert.assertNotNull("Didn't find object in context of transaction", same);

            tx.commit();
View Full Code Here

        // 3. Get a list of some articles
        Transaction tx = odmg.newTransaction();
        tx.begin();
        EnhancedOQLQuery query = odmg.newOQLQuery();
        String sql = "select somePersons from " + Person.class.getName();
        query.create(sql, start, end);
        Collection somePersons = (Collection) query.execute();

        // Iterator over the restricted articles objects
        Iterator it = somePersons.iterator();
        int count = 0;
View Full Code Here

            Transaction tx = odmg.newTransaction();
            tx.begin();

            EnhancedOQLQuery query = odmg.newOQLQuery();
            String sql = "select somePersons from " + Person.class.getName();
            query.create(sql, start, end);
            Collection somePersons = (Collection) query.execute();
            // Iterator over the restricted articles objects
            Iterator it = somePersons.iterator();
            int count = 0;
            while(it.hasNext())
View Full Code Here

            return;
        }

        EnhancedOQLQuery query = odmg.newOQLQuery();
        String sql = "select somePersons from " + Person.class.getName();
        query.create(sql, start, end);
        Collection somePersons = (Collection) query.execute();
        // Iterator over the restricted articles objects
        Iterator it = somePersons.iterator();
        int count = 0;
        while(it.hasNext())
View Full Code Here

        try
        {
            tx.begin();
            EnhancedOQLQuery query = odmg.newOQLQuery();
            String sql = "select somePersons from " + Person.class.getName();
            query.create(sql, start, end);
            query.execute();
            fail("should have thrown QueryInvalidException");
        }
        catch(QueryInvalidException iqe)
        {
View Full Code Here

        {
            tx = odmg.newTransaction();
            tx.begin();
            EnhancedOQLQuery query = odmg.newOQLQuery();
            String sql = "select somePersons from " + Person.class.getName();
            query.create(sql, start, end);
            query.execute();
            fail("should have thrown QueryInvalidException");
        }
        catch(QueryInvalidException iqe)
        {
View Full Code Here

            example.setStock(333);
            example.setArticleName("333");
            conn1.makePersistent(example);

            EnhancedOQLQuery query = conn2.newOQLQuery();
            query.create("select obj from " + Article.class.getName()
                         + " where " + "articleId = " + example.getArticleId());
            Article same = (Article) conn2.getIteratorByOQLQuery(query).next();
            Assert.assertNotNull("Didn't find object in context of transaction", same);

            tx.commit();
View Full Code Here

            example.setStock(333);
            example.setArticleName("333");
            conn1.makePersistent(example);

            EnhancedOQLQuery query = conn2.newOQLQuery();
            query.create("select obj from " + Article.class.getName()
                         + " where " + "articleId = " + example.getArticleId());
            Article same = (Article) conn2.getIteratorByOQLQuery(query).next();
            Assert.assertNotNull("Didn't find object in context of transaction", same);

            tx.commit();
View Full Code Here

            // get from the database via OQLQuery Iterator
            tx = _kit.getTransaction(_conn);
            _conn.invalidate(oid);
            tx.begin();
            oql = _conn.newOQLQuery();
            oql.create("select a from " + Article.class.getName()
                + " where articleId=$1 and articleName=$2");
            oql.bind(new Integer(77777));
            oql.bind("335");
            it = _conn.getIteratorByOQLQuery(oql);
            if (it.hasNext())
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.