Package com.google.appengine.datanucleus.test.jdo

Examples of com.google.appengine.datanucleus.test.jdo.HasEncodedStringPkSeparateNameFieldJDO


      rollbackTxn();
    }
  }

  public void testEncodedStringPk_SeparateNameField() throws EntityNotFoundException {
    HasEncodedStringPkSeparateNameFieldJDO pojo = new HasEncodedStringPkSeparateNameFieldJDO();
    pojo.setName("a name");
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();

    assertEquals(TestUtils.createKey(pojo, "a name"), KeyFactory.stringToKey(pojo.getId()));
    Entity e = ds.get(KeyFactory.stringToKey(pojo.getId()));

    beginTxn();
    pojo = pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, e.getKey().getName());
    assertEquals("a name", pojo.getName());
    pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, e.getKey());
    assertEquals("a name", pojo.getName());
    pm.getObjectById(HasEncodedStringPkSeparateNameFieldJDO.class, KeyFactory.keyToString(e.getKey()));
    assertEquals("a name", pojo.getName());
    commitTxn();

  }
View Full Code Here


    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testDeleteChildWithSeparateNameField(NEW_PM_START_END);
  }
  private void testDeleteChildWithSeparateNameField(StartEnd startEnd) {
    HasChildWithSeparateNameFieldJDO parent = new HasChildWithSeparateNameFieldJDO();
    HasEncodedStringPkSeparateNameFieldJDO child = new HasEncodedStringPkSeparateNameFieldJDO();
    child.setName("the name");
    parent.getChildren().add(child);
    startEnd.start();
    pm.makePersistent(parent);
    startEnd.end();
    startEnd.start();
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.HasEncodedStringPkSeparateNameFieldJDO

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.