Examples of BidirectionalChildListJDO


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

    ds.put(null, grandChildEntity1);
    Entity grandChildEntity2 =
        new Entity(BidirectionalGrandchildListJDO.class.getSimpleName(), childEntity.getKey());
    ds.put(null, grandChildEntity2);

    BidirectionalChildListJDO child =
        pm.getObjectById(BidirectionalChildListJDO.class, KeyFactory.keyToString(childEntity.getKey()));
    Query q = pm.newQuery(
        "select from " + BidirectionalGrandchildListJDO.class.getName()
        + " where parent == p parameters " + BidirectionalChildListJDO.class.getName() + " p");
    List<BidirectionalGrandchildListJDO> result = (List<BidirectionalGrandchildListJDO>) q.execute(child);
View Full Code Here

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

  public void testSerializeWithOneToMany_AddBidirectionalChildToDetached() throws Exception {
    pm.setDetachAllOnCommit(true);
    beginTxn();
    HasOneToManyListJDO pojo = new HasOneToManyListJDO();
    pojo.setVal("yar");
    BidirectionalChildListJDO bidir = new BidirectionalChildListJDO();
    bidir.setChildVal("yar2");
    pojo.addBidirChild(bidir);
    pm.makePersistent(pojo);
    commitTxn();
    pm.close();
    pm = pmf.getPersistenceManager();

    pojo = toBytesAndBack(pojo);
    assertEquals("yar", pojo.getVal());
    assertEquals(1, pojo.getBidirChildren().size());
    BidirectionalChildListJDO bidir2 = new BidirectionalChildListJDO();
    bidir2.setChildVal("yar3");
    pojo.addBidirChild(bidir2);
    bidir2.setParent(pojo);
    beginTxn();
    pojo = pm.makePersistent(pojo);
    commitTxn();
    Entity e = ds.get(KeyFactory.stringToKey(bidir2.getId()));
    assertEquals(KeyFactory.stringToKey(pojo.getId()), e.getKey().getParent());
  }
View Full Code Here

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

  public void testSerializeWithOneToMany_AddChildToReattached() throws Exception {
    pm.setDetachAllOnCommit(true);
    beginTxn();
    HasOneToManyListJDO pojo = new HasOneToManyListJDO();
    pojo.setVal("yar");
    BidirectionalChildListJDO bidir = new BidirectionalChildListJDO();
    bidir.setChildVal("yar2");
    pojo.addBidirChild(bidir);
    pm.makePersistent(pojo);
    commitTxn();
    pm.close();
    pm = pmf.getPersistenceManager();

    pojo = toBytesAndBack(pojo);
    assertEquals("yar", pojo.getVal());
    assertEquals(1, pojo.getBidirChildren().size());
    beginTxn();
    pojo = pm.makePersistent(pojo);
    BidirectionalChildListJDO bidir2 = new BidirectionalChildListJDO();
    bidir.setChildVal("yar3");
    pojo.addBidirChild(bidir2);
    bidir2.setParent(pojo);
    commitTxn();
    Entity e = ds.get(KeyFactory.stringToKey(bidir2.getId()));
    assertEquals(KeyFactory.stringToKey(pojo.getId()), e.getKey().getParent());
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testInsertNewParentAndChild(NEW_PM_START_END);
  }
  private void testInsertNewParentAndChild(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidirChild = new BidirectionalChildListJDO();
    testInsert_NewParentAndChild(parent, bidirChild, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testInsertExistingParentNewChild(NEW_PM_START_END);
  }
  private void testInsertExistingParentNewChild(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidirChild = new BidirectionalChildListJDO();
    testInsert_ExistingParentNewChild(parent, bidirChild, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testSwapAtPosition(NEW_PM_START_END);
  }
  private void testSwapAtPosition(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidirChild = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    testSwapAtPosition(parent, bidirChild, bidirChild2, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testRemoveAtPosition(NEW_PM_START_END);
  }
  private void testRemoveAtPosition(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidirChild = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild3 = new BidirectionalChildListJDO();
    testRemoveAtPosition(parent, bidirChild, bidirChild2, bidirChild3, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testAddAtPosition(NEW_PM_START_END);
  }
  private void testAddAtPosition(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidirChild = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    testAddAtPosition(parent, bidirChild, bidirChild2, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testUpdateUpdateChildWithMerge(NEW_PM_START_END);
  }
  private void testUpdateUpdateChildWithMerge(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO pojo = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidir = new BidirectionalChildListJDO();
    testUpdate_UpdateChildWithMerge(pojo, bidir, startEnd);
  }
View Full Code Here

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

    getExecutionContext().setProperty(PROP_DETACH_ON_CLOSE, true);
    testUpdateUpdateChild(NEW_PM_START_END);
  }
  private void testUpdateUpdateChild(StartEnd startEnd) throws EntityNotFoundException {
    HasOneToManyListJDO pojo = new HasOneToManyListJDO();
    BidirectionalChildListJDO bidir = new BidirectionalChildListJDO();
    testUpdate_UpdateChild(pojo, bidir, startEnd);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.