Examples of BidirectionalChildListJDO


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

  }
  public void xtestRemove2ObjectsAtIndex_NoTxn() {
    testRemove2ObjectsAtIndex(NEW_PM_START_END);
  }
  private void testRemove2ObjectsAtIndex(StartEnd startEnd) {
    BidirectionalChildListJDO bidirChild1 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    Flight f1 = newFlight();
    Flight f2 = newFlight();

    HasKeyPkJDO hasKeyPk1 = new HasKeyPkJDO();
    HasKeyPkJDO hasKeyPk2 = new HasKeyPkJDO();

    HasOneToManyListJDO parent = new HasOneToManyListJDO();
    parent.addBidirChild(bidirChild1);
    bidirChild1.setParent(parent);
    parent.addBidirChild(bidirChild2);
    bidirChild2.setParent(parent);
    parent.addFlight(f1);
    parent.addFlight(f2);
    parent.addHasKeyPk(hasKeyPk1);
    parent.addHasKeyPk(hasKeyPk2);
View Full Code Here

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

    switchDatasource(JDOTestCase.PersistenceManagerFactoryName.nontransactional);
    Flight f1 = newFlight();
    Flight f2 = newFlight();
    Flight f3 = newFlight();
    Flight f4 = newFlight();
    BidirectionalChildListJDO bidirChild1 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild3 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild4 = new BidirectionalChildListJDO();
    HasOneToManyListJDO parent1 = new HasOneToManyListJDO();
    parent1.getFlights().add(f1);
    parent1.getFlights().add(f2);
    parent1.getBidirChildren().add(bidirChild1);
    parent1.getBidirChildren().add(bidirChild2);
    HasOneToManyListJDO parent2 = new HasOneToManyListJDO();
    parent2.getFlights().add(f3);
    parent2.getFlights().add(f4);
    parent2.getBidirChildren().add(bidirChild3);
    parent2.getBidirChildren().add(bidirChild4);
    pm.makePersistentAll(parent1, parent2);
    assertEquals(2, countForClass(HasOneToManyListJDO.class));
    assertEquals(4, countForClass(Flight.class));
    assertEquals(4, countForClass(BidirectionalChildListJDO.class));
    assertEquals(1, batchRecorder.batchOps);

    Entity parent1Entity = ds.get(KeyFactory.stringToKey(parent1.getId()));
    Entity parent2Entity = ds.get(KeyFactory.stringToKey(parent2.getId()));
    Entity flight1Entity = ds.get(KeyFactory.stringToKey(f1.getId()));
    Entity flight2Entity = ds.get(KeyFactory.stringToKey(f2.getId()));
    Entity flight3Entity = ds.get(KeyFactory.stringToKey(f3.getId()));
    Entity flight4Entity = ds.get(KeyFactory.stringToKey(f4.getId()));
    Entity bidir1Entity = ds.get(KeyFactory.stringToKey(bidirChild1.getId()));
    Entity bidir2Entity = ds.get(KeyFactory.stringToKey(bidirChild2.getId()));
    Entity bidir3Entity = ds.get(KeyFactory.stringToKey(bidirChild3.getId()));
    Entity bidir4Entity = ds.get(KeyFactory.stringToKey(bidirChild4.getId()));
    assertEquals(4, parent1Entity.getProperties().size());
    assertTrue(parent1Entity.hasProperty("hasKeyPks"));
    assertNull(parent1Entity.getProperty("hasKeyPks"));
    assertEquals(
        Utils.newArrayList(flight1Entity.getKey(), flight2Entity.getKey()),
View Full Code Here

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

    switchDatasource(JDOTestCase.PersistenceManagerFactoryName.transactional);
    Flight f1 = newFlight();
    Flight f2 = newFlight();
    Flight f3 = newFlight();
    Flight f4 = newFlight();
    BidirectionalChildListJDO bidirChild1 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild3 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild4 = new BidirectionalChildListJDO();
    HasOneToManyListJDO parent1 = new HasOneToManyListJDO();
    parent1.getFlights().add(f1);
    parent1.getFlights().add(f2);
    parent1.getBidirChildren().add(bidirChild1);
    parent1.getBidirChildren().add(bidirChild2);
View Full Code Here

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

    switchDatasource(JDOTestCase.PersistenceManagerFactoryName.transactional);
    Flight f1 = newFlight();
    Flight f2 = newFlight();
    Flight f3 = newFlight();
    Flight f4 = newFlight();
    BidirectionalChildListJDO bidirChild1 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild2 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild3 = new BidirectionalChildListJDO();
    BidirectionalChildListJDO bidirChild4 = new BidirectionalChildListJDO();
    HasOneToManyListJDO parent1 = new HasOneToManyListJDO();
    parent1.setId(new KeyFactory.Builder("Yar", 43).addChild(HasOneToManyListJDO.class.getSimpleName(), "k1").getString());
    parent1.getFlights().add(f1);
    parent1.getFlights().add(f2);
    parent1.getBidirChildren().add(bidirChild1);
    parent1.getBidirChildren().add(bidirChild2);
    HasOneToManyListJDO parent2 = new HasOneToManyListJDO();
    parent2.setId(new KeyFactory.Builder("Yar", 43).addChild(HasOneToManyListJDO.class.getSimpleName(), "k2").getString());
    parent2.getFlights().add(f3);
    parent2.getFlights().add(f4);
    parent2.getBidirChildren().add(bidirChild3);
    parent2.getBidirChildren().add(bidirChild4);
    beginTxn();
    pm.makePersistentAll(parent1, parent2);
    commitTxn();
    assertEquals(2, countForClass(HasOneToManyListJDO.class));
    assertEquals(4, countForClass(Flight.class));
    assertEquals(4, countForClass(BidirectionalChildListJDO.class));
    assertEquals(1, batchRecorder.batchOps);

    Entity parent1Entity = ds.get(KeyFactory.stringToKey(parent1.getId()));
    Entity parent2Entity = ds.get(KeyFactory.stringToKey(parent2.getId()));
    Entity flight1Entity = ds.get(KeyFactory.stringToKey(f1.getId()));
    Entity flight2Entity = ds.get(KeyFactory.stringToKey(f2.getId()));
    Entity flight3Entity = ds.get(KeyFactory.stringToKey(f3.getId()));
    Entity flight4Entity = ds.get(KeyFactory.stringToKey(f4.getId()));
    Entity bidir1Entity = ds.get(KeyFactory.stringToKey(bidirChild1.getId()));
    Entity bidir2Entity = ds.get(KeyFactory.stringToKey(bidirChild2.getId()));
    Entity bidir3Entity = ds.get(KeyFactory.stringToKey(bidirChild3.getId()));
    Entity bidir4Entity = ds.get(KeyFactory.stringToKey(bidirChild4.getId()));
    assertEquals(4, parent1Entity.getProperties().size());
    assertTrue(parent1Entity.hasProperty("hasKeyPks"));
    assertNull(parent1Entity.getProperty("hasKeyPks"));
    assertEquals(
        Utils.newArrayList(flight1Entity.getKey(), flight2Entity.getKey()),
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.