Package com.google.appengine.datanucleus

Examples of com.google.appengine.datanucleus.Migrator


    Key pIdKey = (Key)pId.getKey();
    Key cIdKey = (Key)cId.getKey();
    oldPM.close();

    // Migrate the data
    Migrator migrator = new Migrator(((JDOPersistenceManagerFactory)oldPMF).getNucleusContext());
    try {
      // Migrate the parent
      Entity pEntity = ds.get(pIdKey);
      boolean changed = migrator.migrate(pEntity, MigratorOneToOneParent.class);
      assertTrue("Parent entity should have been changed but wasnt", changed);
      if (changed) {
        ds.put(pEntity);
      }

      // Migrate the child
      Entity cEntity = ds.get(cIdKey);
      changed = migrator.migrate(cEntity, MigratorOneToOneChild.class);
      assertFalse("Child entity shouldnt have been changed but was", changed);
      if (changed) {
        ds.put(cEntity);
      }
View Full Code Here


    Key pIdKey = (Key)pId.getKey();
    Key cIdKey = (Key)cId.getKey();
    oldPM.close();

    // Migrate the data
    Migrator migrator = new Migrator(((JDOPersistenceManagerFactory)oldPMF).getNucleusContext());
    try {
      // Migrate the parent
      Entity pEntity = ds.get(pIdKey);
      boolean changed = migrator.migrate(pEntity, MigratorOneToManyParent.class);
      assertTrue("Parent entity should have been changed but wasnt", changed);
      if (changed) {
        ds.put(pEntity);
      }

      // Migrate the child
      Entity cEntity = ds.get(cIdKey);
      changed = migrator.migrate(cEntity, MigratorOneToManyChild.class);
      assertFalse("Child entity shouldnt have been changed but was", changed);
      if (changed) {
        ds.put(cEntity);
      }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.Migrator

Copyright © 2018 www.massapicom. 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.