Package javax.jdo

Examples of javax.jdo.PersistenceManager.detachCopy()


    pm.makePersistent(parent);
    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
    try {
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address can be accessed: " + detachedParent.getAddress().toString());
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
View Full Code Here



        {
            PersistenceManager pm = pmf.getPersistenceManager();
            pm.getFetchPlan().setGroup("bookInfo");
            pm.detachCopy(pm.getObjectById(Book.class, new Long(0)));
            pm.close();
        }

        {
            Collection books = loadNDetachBooks("shortTitle", true, 0, Integer.MAX_VALUE);
View Full Code Here

    FetchPlan f = pm.getFetchPlan();
    logger.log(BasicLevel.DEBUG, "FG: " + f.getGroups());
   
    try{
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "All fields can be accessed: " + detachedParent.toString());
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
      assertEquals(parent.getAddress().getCity(), detachedParent.getAddress().getCity());
      assertEquals(parent.getAddress().getCountry().getCode(), detachedParent.getAddress().getCountry().getCode());
View Full Code Here

    FetchPlan f = pm.getFetchPlan();
    logger.log(BasicLevel.DEBUG, "FG: " + f.getGroups());
   
    try{   
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address can be accessed: " + detachedParent.getAddress().toString());
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
View Full Code Here

    FetchPlan f = pm.getFetchPlan();
    logger.log(BasicLevel.DEBUG, "FG: " + f.getGroups());
   
    try
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address should not be accessed: " + detachedParent.getAddress());
View Full Code Here

    FetchPlan f = pm.getFetchPlan();
    logger.log(BasicLevel.DEBUG, "FG: " + f.getGroups());
   
    try{
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address should not be accessed: " + detachedParent.getAddress());
View Full Code Here

    pm.currentTransaction().commit();
   
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
    try {
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address can be accessed: " +
          detachedParent.getAddress().getStreet() + ", " + detachedParent.getAddress().getCity()
          + ", " + detachedParent.getAddress().getCountry().getCode());
View Full Code Here

    pm.currentTransaction().commit();
   
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
    try {
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      logger.log(BasicLevel.DEBUG, "Name can be accessed: " + detachedParent.getName());
      logger.log(BasicLevel.DEBUG, "Age can be accessed: " + detachedParent.getAge());
      logger.log(BasicLevel.DEBUG, "Address can be accessed: " +
          detachedParent.getAddress().getStreet() + ", " + detachedParent.getAddress().getCity()
          + ", " + detachedParent.getAddress().getCountry().getCode());
View Full Code Here

    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
   
    try {
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
      assertEquals(parent.getAddress().getCity(), detachedParent.getAddress().getCity());
      assertEquals(parent.getAddress().getCountry().getCode(), detachedParent.getAddress().getCountry().getCode());
      assertEquals(parent.getAddress().getCountry().getName(), detachedParent.getAddress().getCountry().getName());
View Full Code Here

    pm.currentTransaction().commit();
    logger.log(BasicLevel.DEBUG, "FG: " + fp.getGroups());
   
    try{
      pm.currentTransaction().begin();
      Person detachedParent = (Person) pm.detachCopy(parent);
      assertEquals(parent.getName(), detachedParent.getName());
      assertEquals(parent.getAge(), detachedParent.getAge());
      assertEquals(parent.getAddress().getCity(), detachedParent.getAddress().getCity());
      assertEquals(parent.getAddress().getCountry().getCode(), detachedParent.getAddress().getCountry().getCode());
      assertEquals(parent.getAddress().getCountry().getName(), detachedParent.getAddress().getCountry().getName());
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.