Package com.google.appengine.datanucleus.test.jpa

Examples of com.google.appengine.datanucleus.test.jpa.HasEncodedStringPkSeparateIdFieldJPA


    commitTxn();

  }

  public void testEncodedStringPk_SeparateIdField() throws EntityNotFoundException {
    HasEncodedStringPkSeparateIdFieldJPA pojo = new HasEncodedStringPkSeparateIdFieldJPA();
    pojo.setId(34L);
    beginTxn();
    em.persist(pojo);
    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 = em.find(HasEncodedStringPkSeparateIdFieldJPA.class, e.getKey().getId());
    assertEquals(id, pojo.getId().longValue());
    em.find(HasEncodedStringPkSeparateIdFieldJPA.class, e.getKey());
    assertEquals(id, pojo.getId().longValue());
    em.find(HasEncodedStringPkSeparateIdFieldJPA.class, KeyFactory.keyToString(e.getKey()));
    assertEquals(id, pojo.getId().longValue());
    commitTxn();

  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jpa.HasEncodedStringPkSeparateIdFieldJPA

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.