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

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


    commitTxn();

  }

  public void testEncodedStringPk_SeparateIdField() throws EntityNotFoundException {
    HasEncodedStringPkSeparateIdFieldJDO pojo = new HasEncodedStringPkSeparateIdFieldJDO();
    pojo.setId(34L);
    beginTxn();
    pm.makePersistent(pojo);
    assertNotNull(pojo.getId());
    commitTxn();
    beginTxn();
    assertNotNull(pojo.getId());
    assertNotNull(pojo.getKey());
    Entity e = ds.get(TestUtils.createKey(pojo, pojo.getId()));
    long id = e.getKey().getId();
    assertEquals(34L, id);
    pojo = pm.getObjectById(HasEncodedStringPkSeparateIdFieldJDO.class, e.getKey().getId());
    assertEquals(id, pojo.getId().longValue());
    pm.getObjectById(HasEncodedStringPkSeparateIdFieldJDO.class, e.getKey());
    assertEquals(id, pojo.getId().longValue());
    pm.getObjectById(HasEncodedStringPkSeparateIdFieldJDO.class, KeyFactory.keyToString(e.getKey()));
    assertEquals(id, pojo.getId().longValue());
    commitTxn();

  }
View Full Code Here

TOP

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

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.