Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.QueryResults.absolute()


    public void testAbsoluteA() throws PersistenceException {
        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
View Full Code Here


        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
        _db.commit();
View Full Code Here

        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
        _db.commit();
    }
View Full Code Here

                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
        _db.commit();
    }
View Full Code Here

        QueryResults enumeration = oqlquery.execute(true);
        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
        _db.commit();
    }

    /**
 
View Full Code Here

        assertTrue("should have been able to move to 1", enumeration.absolute(1));
        assertTrue("should have been able to move to 5", enumeration.absolute(5));
        assertTrue("should have been able to move to 10", enumeration.absolute(10));
        assertTrue("should have been able to move to 15", enumeration.absolute(15));
        assertTrue("should have been able to move to 20", enumeration.absolute(20));
        assertTrue("should have been able to move to 25", enumeration.absolute(25));
        _db.commit();
    }

    /**
     * Test going through enumeration and calling absolute
View Full Code Here

        QueryResults enumeration = oqlquery.execute(true);
        int next = 1;
        boolean hasMore = true;
        while (enumeration.hasMore() && hasMore) {
            LOG.debug("at: " + next);
            hasMore = enumeration.absolute(next);
            next++;
        }
        _db.commit();
    }
View Full Code Here

    public void testAbsoluteC() throws PersistenceException {
        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertFalse("shouldn't be able to move to -50", enumeration.absolute(-50));
        assertFalse("shouldn't be able to move to 99999", enumeration.absolute(99999));
        _db.commit();
    }

    /**
 
View Full Code Here

        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        assertFalse("shouldn't be able to move to -50", enumeration.absolute(-50));
        assertFalse("shouldn't be able to move to 99999", enumeration.absolute(99999));
        _db.commit();
    }

    /**
     * Should fail with a non scrollable resultset.?
View Full Code Here

            _db.begin();
            OQLQuery oqlquery = _db.getOQLQuery(
                    "SELECT object FROM " + Entity.class.getName() + " object");
            QueryResults enumeration = oqlquery.execute(false);
            // following should fail.
            enumeration.absolute(5);
            _db.commit();
            fail("Calling absolute on a non-scrollable resultset should fail");
        } catch (Exception ex) {
            assertTrue(true);
        }
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.