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

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


    assertEquals(Utils.newArrayList("bar1", "bar2"), pojo.getEmbedded1().getEmbedded2().getMultiVal2());
    commitTxn();
  }

  public void testEmbeddedWithKeyPk_NullEmbedded() {
    HasEmbeddedWithKeyPkJDO pojo = new HasEmbeddedWithKeyPkJDO();
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();
    pm.evictAll();
    pmf.getDataStoreCache().evictAll();

    // Failed on GAE v1.x
    beginTxn();
    pojo = pm.getObjectById(HasEmbeddedWithKeyPkJDO.class, pojo.getId());
    assertNull(pojo.getEmbedded());
    commitTxn();
  }
View Full Code Here


    assertNull(pojo.getEmbedded());
    commitTxn();
  }

  public void testEmbeddedWithKeyPk_NotNullEmbedded() {
    HasEmbeddedWithKeyPkJDO pojo = new HasEmbeddedWithKeyPkJDO();
    HasKeyPkJDO embedded = new HasKeyPkJDO();
    embedded.setStr("yar");
    pojo.setEmbedded(embedded);
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();
    pm.evictAll();
    pmf.getDataStoreCache().evictAll();

    beginTxn();
    pojo = pm.getObjectById(HasEmbeddedWithKeyPkJDO.class, pojo.getId());
    assertNotNull(pojo.getEmbedded());
    assertEquals("yar", pojo.getEmbedded().getStr());
    commitTxn();
  }
View Full Code Here

    assertEquals("yar", pojo.getEmbedded().getStr());
    commitTxn();
  }

  public void testEmbeddedWithKeyPk_AddEmbeddedToExistingParent() {
    HasEmbeddedWithKeyPkJDO pojo = new HasEmbeddedWithKeyPkJDO();
    beginTxn();
    pm.makePersistent(pojo);
    commitTxn();

    HasKeyPkJDO embedded = new HasKeyPkJDO();
    embedded.setStr("yar");
    beginTxn();
    pojo.setEmbedded(embedded);
    pojo = pm.getObjectById(HasEmbeddedWithKeyPkJDO.class, pojo.getId());
    pojo.setEmbedded(embedded);
    commitTxn();
  }
View Full Code Here

TOP

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

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.