Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.OQLQuery.execute()


       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here


       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

                oql = db.getOQLQuery(_oqlquery.getText());


                // and execute it
                Date starttime = new Date();
                r = oql.execute(Database.READONLY);
                Date endtime = new Date();
                // write the status bar
                _statusBar.setText("Query successful, Time: "
                        + (endtime.getTime() - starttime.getTime()) + " ms");
View Full Code Here

        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT entity FROM "
                + Entity.class.getName() + " entity WHERE id = $1");
        query.bind(new Integer(1));
        QueryResults results = query.execute();
       
        Entity entity = (Entity) results.next();

        assertNotNull(entity);
        assertEquals(new Integer(1), entity.getId());
View Full Code Here

        // Create two objects in the database -- need something to lock
        OQLQuery oql = _db.getOQLQuery("SELECT object FROM "
                + Sample.class.getName() + " object WHERE id = $1");
        oql.bind(Sample.DEFAULT_ID);

        enumeration = oql.execute();
        if (enumeration.hasMoreElements()) {
            object = (Sample) enumeration.nextElement();
            LOG.debug("Retrieved object: " + object);
            object.setValue1(Sample.DEFAULT_VALUE_1);
            object.setValue2(Sample.DEFAULT_VALUE_2);
View Full Code Here

            _db.create(object);
        }
       
        oql.bind(Sample.DEFAULT_ID + 1);
       
        enumeration = oql.execute();
        if (enumeration.hasMoreElements()) {
            object = (Sample) enumeration.nextElement();
            LOG.debug("Retrieved object: " + object);
            object.setValue1(Sample.DEFAULT_VALUE_1);
            object.setValue2(Sample.DEFAULT_VALUE_2);
View Full Code Here

            //get database - this should be bound to the transaction above
            _db = _category.getDatabase(_verbose);
            //execute some test OQL
            oql = _db.getOQLQuery(
                    "SELECT master FROM " + Master.class.getName() + " master");   
            enumeration = oql.execute();
            while (enumeration.hasMore()) { enumeration.next(); }
            //commit the transaction
            ut.commit();
        } catch (TransactionNotInProgressException e) {
            LOG.error (e.getClass().getName(), e);
View Full Code Here

    public void runTest() throws PersistenceException, SQLException {
        _db.begin();
       
        OQLQuery query = _db.getOQLQuery(
                "select o from " + Sample.class.getName() + " o");
        QueryResults result = query.execute();
        while (result.hasMore()) { _db.remove(result.next()); }
        result.close();
        _db.commit();
       
        _synchronizables.clear();
View Full Code Here

        num = 0;
        for (int i = 0; i < jdos.length; i++) {
            oql = _masterDB.getOQLQuery("SELECT object FROM " + _className
                    + " object WHERE id = $1");
            oql.bind(i);
            enumeration = oql.execute();
            if (enumeration.hasMoreElements()) {
                Race tr = (Race) enumeration.nextElement();
                if (tr.getValue1() == controls[i].getValue1()) { num++; }
                LOG.debug("Number Pair " + i + " -- JDO: "
                        + tr.getValue1() + " control: "
View Full Code Here

    public void testQueryEntityOne() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
        OQLQuery aquery = db.getOQLQuery(
                "SELECT c FROM " + Container.class.getName() + " c");
        QueryResults aresults = aquery.execute();
        int i = 1;
        while (aresults.hasMore()) {
            Container container = (Container) aresults.next();
            assertNotNull(container);
            assertEquals(new Integer(i), container.getId());
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.