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

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


* @author Max Ross <maxr@google.com>
*/
public class JPATableAndColumnTest extends JPATestCase {

  public void testInsert() throws EntityNotFoundException {
    HasTableAndColumnsInMappingJPA htacim = new HasTableAndColumnsInMappingJPA();
    htacim.setFoo("foo val");
    beginTxn();
    em.persist(htacim);
    commitTxn();
    assertNotNull(htacim.getId());
    Entity entity = ds.get(KeyFactory.createKey(
        HasTableAndColumnsInMappingJPA.TABLE_NAME, htacim.getId()));
    assertNotNull(entity);
    assertEquals(HasTableAndColumnsInMappingJPA.TABLE_NAME, entity.getKind());
    assertEquals("foo val", entity.getProperty(HasTableAndColumnsInMappingJPA.FOO_COLUMN_NAME));
  }
View Full Code Here


    entity.setProperty(HasTableAndColumnsInMappingJPA.FOO_COLUMN_NAME, "foo val");
    Key key = ds.put(entity);

    String keyStr = KeyFactory.keyToString(key);
    beginTxn();
    HasTableAndColumnsInMappingJPA htacim = em.find(HasTableAndColumnsInMappingJPA.class, keyStr);
    assertNotNull(htacim);
    assertEquals(Long.valueOf(key.getId()), htacim.getId());
    assertEquals("foo val", htacim.getFoo());
    commitTxn();
  }
View Full Code Here

TOP

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

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.