Package javax.jdo

Examples of javax.jdo.PersistenceManager.deletePersistent()


          mem1 = (Member) pm.getObjectById(m1Id, true);
         
          // Delete both members
          pm.currentTransaction().begin();
          pm.deletePersistent(mem1);
          pm.deletePersistent(mem2);
          pm.currentTransaction().commit();
          Assert.fail("Should have thrown a JDOUserException : member 1 has not been deleted");
        }
        catch (JDOUserException jdoEx) {
          // The test has passed
View Full Code Here


              + idx, F1_PREFIX + i, bs[i].getF1());
    }
    a.clear();
    pm.currentTransaction().begin();
    pm.deletePersistentAll(bs);
    pm.deletePersistent(a);
    pm.currentTransaction().commit();
    pm.close();
  }
}
View Full Code Here

        Assert.assertEquals("Bad ints set size", e1.getIntsCol().size(), 1);
        Assert.assertTrue("Bad ints set content", e1.getIntsCol().iterator().hasNext());
        Assert.assertNotNull("Bad ints set content", e1.getIntsCol().iterator().next());
        Assert.assertTrue("Bad ints set content", e1.getIntsCol().contains(new Integer(1)));
        pm.currentTransaction().begin();
        pm.deletePersistent(e2);
        pm.deletePersistent(e1);
        pm.currentTransaction().commit();
        pm.close();
    }
View Full Code Here

        Assert.assertTrue("Bad ints set content", e1.getIntsCol().iterator().hasNext());
        Assert.assertNotNull("Bad ints set content", e1.getIntsCol().iterator().next());
        Assert.assertTrue("Bad ints set content", e1.getIntsCol().contains(new Integer(1)));
        pm.currentTransaction().begin();
        pm.deletePersistent(e2);
        pm.deletePersistent(e1);
        pm.currentTransaction().commit();
        pm.close();
    }

    public void testCreation4() {
View Full Code Here

        Assert.assertTrue("Bad ints set content", e1.getIntsCol().iterator().hasNext());
        Assert.assertNotNull("Bad ints set content", e1.getIntsCol().iterator().next());
        Assert.assertTrue("Bad ints set content", e1.getIntsCol().contains(new Integer(1)));
        Object o = e2.getName();
        pm.currentTransaction().begin();
        pm.deletePersistent(e1);
        pm.deletePersistent(e2);
        pm.currentTransaction().commit();
        pm.close();
    }
View Full Code Here

        Assert.assertNotNull("Bad ints set content", e1.getIntsCol().iterator().next());
        Assert.assertTrue("Bad ints set content", e1.getIntsCol().contains(new Integer(1)));
        Object o = e2.getName();
        pm.currentTransaction().begin();
        pm.deletePersistent(e1);
        pm.deletePersistent(e2);
        pm.currentTransaction().commit();
        pm.close();
    }

    public void testCollectionLoading() {
View Full Code Here

    assertTrue("User is not marked as Dirty after the makePersitent action: ",
      JDOHelper.isDirty(user));
        pm.currentTransaction().commit();

    pm.currentTransaction().begin();
    pm.deletePersistent(user);
    pm.deletePersistent(group);
        pm.currentTransaction().commit();

        pm.close();
View Full Code Here

      JDOHelper.isDirty(user));
        pm.currentTransaction().commit();

    pm.currentTransaction().begin();
    pm.deletePersistent(user);
    pm.deletePersistent(group);
        pm.currentTransaction().commit();

        pm.close();

  }
View Full Code Here

   
    /* Delete the group :
     * this should delete its members too.
     */
    pm.currentTransaction().begin();
    pm.deletePersistent(grp);
    pm.currentTransaction().commit();
        pm.close();
      
        // Check that the members have been deleted too
        pm = pmf.getPersistenceManager();
View Full Code Here

                System.out.println("No ProductUnits referenced by the invoice");
            }
            while(puit.hasNext()) {
                ProductUnits pu = (ProductUnits) puit.next();
                System.out.println("remove : " + pu);
                pm.deletePersistent(pu);
            }
            pm.deletePersistent(i);
        }
        q.closeAll();
        pm.currentTransaction().commit();
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.