Package javax.jdo

Examples of javax.jdo.PersistenceManager.deletePersistent()


    Assert.assertEquals("Bad group name", gName, grp.getName());
   
    /* Delete the group.
     */
    pm.currentTransaction().begin();
    pm.deletePersistent(grp);
    pm.currentTransaction().commit();
        pm.close();
      
        // Check that the group has been deleted
        pm = pmf.getPersistenceManager();
View Full Code Here


                Iterator it = col.iterator();
                while(it.hasNext()) {
                    Object o = it.next();
                    Assert.assertNotNull("null object in the query result"
                        + cs[i].getName(), o);
                    pm.deletePersistent(o);

                }
                query.close(col);
            }
          pm.currentTransaction().commit();
View Full Code Here

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

        r2 = (Registry) r1.lookup("a");
        Assert.assertNotNull("null instance returned by r1.lookup(a)", r2);
        r3 = (Registry) r1.lookup("b");
        Assert.assertNotNull("null instance returned by r1.lookup(b)", r3);
        pm.currentTransaction().begin();
        pm.deletePersistent(r1);
        pm.deletePersistent(r2);
        pm.deletePersistent(r3);
        pm.currentTransaction().commit();
        pm.close();
    }
View Full Code Here

        Assert.assertNotNull("null instance returned by getObjectById", e1);
        Assert.assertEquals("Bad employee name", "e1", e1.getName());
        Assert.assertNotNull("null instance returned by getObjectById", e1.getBoss());
        Assert.assertEquals("Bad boss name", "e2", e1.getBoss().getName());
        pm.currentTransaction().begin();
        pm.deletePersistent(e1);
        pm.deletePersistent(e1.getBoss());
        pm.currentTransaction().commit();
        pm.close();
  }
View Full Code Here

        r3 = (Registry) r1.lookup("b");
        Assert.assertNotNull("null instance returned by r1.lookup(b)", r3);
        pm.currentTransaction().begin();
        pm.deletePersistent(r1);
        pm.deletePersistent(r2);
        pm.deletePersistent(r3);
        pm.currentTransaction().commit();
        pm.close();
    }

  public void testA() {
View Full Code Here

        Assert.assertEquals("Bad employee name", "e1", e1.getName());
        Assert.assertNotNull("null instance returned by getObjectById", e1.getBoss());
        Assert.assertEquals("Bad boss name", "e2", e1.getBoss().getName());
        pm.currentTransaction().begin();
        pm.deletePersistent(e1);
        pm.deletePersistent(e1.getBoss());
        pm.currentTransaction().commit();
        pm.close();
  }

    public void testCreation2() {
View Full Code Here

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

        try {
          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) {
View Full Code Here

        Assert.assertNotNull("null instance returned by getObjectById", e1);
        Assert.assertEquals("Bad employee name", "e1", e1.getName());
        Assert.assertNotNull("null instance returned by getObjectById", e1.getBoss());
        Assert.assertEquals("Bad boss", e1, e1.getBoss());
        pm.currentTransaction().begin();
        pm.deletePersistent(e1);
        pm.currentTransaction().commit();
        pm.close();
    }

    public void testCreation3() {
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.