Package javax.jdo

Examples of javax.jdo.Query.closeAll()


        while(it.hasNext()) {
            Address a = (Address) it.next();
            System.out.println("Address (" + a + ")");
            i++;
        }
        q.closeAll();
        System.out.println("There is " + i + " addresses.");

        q = pm.newQuery(Invoice.class);
        col = (Collection) q.execute();
        it = col.iterator();
View Full Code Here


        while(it.hasNext()) {
            Invoice in = (Invoice) it.next();
            System.out.println("Invoice (" + in + ")");
            i++;
        }
        q.closeAll();
        System.out.println("There is " + i + " invoices.");
        pm.close();
    }

    public void removeProducts() {
View Full Code Here

        PersistenceManager pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        Query q = pm.newQuery(Product.class);

        pm.deletePersistentAll((Collection) q.execute());
        q.closeAll();
        pm.currentTransaction().commit();
        pm.close();
    }

    public void removeAddresses() {
View Full Code Here

    public void removeAddresses() {
        PersistenceManager pm = pmf.getPersistenceManager();
        pm.currentTransaction().begin();
        Query q = pm.newQuery(Address.class);
        pm.deletePersistentAll((Collection) q.execute());
        q.closeAll();
        pm.currentTransaction().commit();
        pm.close();
    }

    public void removeInvoices() {
View Full Code Here

                System.out.println("remove : " + pu);
                pm.deletePersistent(pu);
            }
            pm.deletePersistent(i);
        }
        q.closeAll();
        pm.currentTransaction().commit();
        pm.close();
    }

    public void removeInvoice(Invoice i) {
View Full Code Here

        for (Iterator it = c.iterator(); it.hasNext();) {
            Address a = (Address) it.next();
            logger.log(BasicLevel.INFO, "- Address found:" + a.toString());
        }
        as = new ArrayList(c);
        q.closeAll();
        pm.currentTransaction().commit();
       
        pm.currentTransaction().begin();
        logger.log(BasicLevel.INFO, "Delete " + as.size() + " multi table addresses.");
        pm.deletePersistentAll(as);
View Full Code Here

        emps.addAll(c);
        q.closeAll();
        q = pm.newQuery(Department.class);
        c = (Collection) q.execute();
        deps.addAll(c);
        q.closeAll();
        logger.log(BasicLevel.INFO, "Delete " + deps.size() + " departments.");
        pm.deletePersistentAll(deps);
        logger.log(BasicLevel.INFO, "Delete " + emps.size() + " employees.");
        pm.deletePersistentAll(emps);
        pm.currentTransaction().commit();
View Full Code Here

        logger.log(BasicLevel.INFO, "Search all A (including C and D instances):");
        for (Iterator it = c.iterator(); it.hasNext();) {
            A a = (A) it.next();
            logger.log(BasicLevel.INFO, "\t- " + a.getAid());
        }
        q.closeAll();
        pm.currentTransaction().commit();

        pm.currentTransaction().begin();
        q = pm.newQuery(A.class);
        c = new ArrayList((Collection) q.execute());
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();
        return this;
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.