Package javax.jdo

Examples of javax.jdo.Query.closeAll()


      Concurrent c = (Concurrent) it.next();
      System.out.println("concurrent : cid=" + c.getCid()
        + ", dossard=" + c.getDossard()
        + ", temps=" + c.getTemps());
    }
    q.closeAll();
    pm.close();

    pm = pmf.getPersistenceManager();
    pm.currentTransaction().begin();
    Extent e = pm.getExtent(Concurrent.class, false);
View Full Code Here


        ArrayList found = new ArrayList();
        for (Iterator it = c.iterator(); it.hasNext();) {
            A a = (A) it.next();
            found.add(a.getAid());
        }
        q.closeAll();
        assertSameCollection("Bad result of query on all A instances", expected, found);
        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        q = pm.newQuery(A.class);
View Full Code Here

        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        q = pm.newQuery(A.class);
        c = new ArrayList((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(E.class);
        c.addAll((Collection) q.execute());
        q.closeAll();
        pm.deletePersistentAll(c);
        pm.currentTransaction().commit();
View Full Code Here

        q = pm.newQuery(A.class);
        c = new ArrayList((Collection) q.execute());
        q.closeAll();
        q = pm.newQuery(E.class);
        c.addAll((Collection) q.execute());
        q.closeAll();
        pm.deletePersistentAll(c);
        pm.currentTransaction().commit();
       
        pm.close();
    }
View Full Code Here

      while(it.hasNext()){
        Team t = (Team) it.next();
        logger.log(BasicLevel.DEBUG, t.toString());
      }
      Collection detachedTeams = (Collection) pm.detachCopyAll(results);
      query.closeAll();
      return detachedTeams;
    }
    catch(Exception e){
      logger.log(BasicLevel.DEBUG, e.toString());
      return null;
View Full Code Here

      while(it.hasNext()){
        A a = (A) it.next();
        logger.log(BasicLevel.DEBUG, "" + a.toString());
      }
      Collection detachedAs = (Collection) pm.detachCopyAll(results);
      query.closeAll();
      return detachedAs;
    }
    catch(Exception e){
      logger.log(BasicLevel.DEBUG, e.toString());
      return null;
View Full Code Here

      Iterator it = results.iterator();
      while(it.hasNext()){
        A1 a = (A1) it.next();
        assertEquals(bid, a.getB().getB1());
      }
      query.closeAll();
    } catch (Exception e) {
      fail(e.getMessage());
    } finally {
      pm.evictAll();
      pm.close();
View Full Code Here

        Iterator it = products.iterator();
        while(it.hasNext()) {
            pus.add(new ProductUnits(
                    (Product) it.next(), null, 20, pus.size()));
        }
        q.closeAll();

        //Fetch the address of the invoice
        q = pm.newQuery(Address.class);
        q.setFilter("(name == n)");
        q.declareParameters("String n");
View Full Code Here

        q = pm.newQuery(Address.class);
        q.setFilter("(name == n)");
        q.declareParameters("String n");
        Collection addresses = (Collection) q.execute("Seb");
        Address sebAddress = (Address) addresses.iterator().next();
        q.closeAll();

        //Build the invoice
        Invoice invoice = new Invoice(217, sebAddress, pus);
        //manage the reverse reference between Invoice and ProductUnits
        for(int i=0; i<pus.size(); i++) {
View Full Code Here

        while(it.hasNext()) {
            Product p = (Product) it.next();
            System.out.println("Product (" + p + ")");
            i++;
        }
        q.closeAll();
        System.out.println("There is " + i + " products.");

        q = pm.newQuery(Address.class);
        col = (Collection) q.execute();
        it = col.iterator();
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.