Examples of BidirectionalChildLongPkListJPA


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

  }
  public void testInsert_NewParentAndChild_LongPk_NoTxn() throws Exception {
    testInsert_NewParentAndChild_LongPk(NEW_EM_START_END);
  }
  private void testInsert_NewParentAndChild_LongPk(StartEnd startEnd) throws Exception {
    BidirectionalChildLongPkListJPA bidirChild = new BidirectionalChildLongPkListJPA();
    bidirChild.setChildVal("yam");

    Book b = newBook();

    HasKeyPkJPA hasKeyPk = new HasKeyPkJPA();
    hasKeyPk.setStr("yag");

    HasOneToManyLongPkListJPA parent = new HasOneToManyLongPkListJPA();
    parent.getBidirChildren().add(bidirChild);
    bidirChild.setParent(parent);
    parent.getBooks().add(b);
    parent.getHasKeyPks().add(hasKeyPk);
    parent.setVal("yar");

    startEnd.start();
    em.persist(parent);
    startEnd.end();

    assertNotNull(bidirChild.getId());
    assertNotNull(b.getId());
    assertNotNull(hasKeyPk.getId());

    Entity bidirChildEntity = ds.get(KeyFactory.stringToKey(bidirChild.getId()));
    assertNotNull(bidirChildEntity);
    assertEquals("yam", bidirChildEntity.getProperty("childVal"));
    assertEquals(KeyFactory.stringToKey(bidirChild.getId()), bidirChildEntity.getKey());
    assertKeyParentEquals(parent.getClass(), parent.getId(), bidirChildEntity, bidirChild.getId());

    Entity bookEntity = ds.get(KeyFactory.stringToKey(b.getId()));
    assertNotNull(bookEntity);
    assertEquals("max", bookEntity.getProperty("author"));
    assertEquals("22333", bookEntity.getProperty("isbn"));
View Full Code Here

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

    testFetchOfOneToManyParentWithUnencodedStringPk(new HasOneToManyUnencodedStringPkListJPA(), NEW_EM_START_END);
  }

  public void testAddChildToOneToManyParentWithLongPk() throws Exception {
    testAddChildToOneToManyParentWithLongPk(
        new HasOneToManyLongPkListJPA(), new BidirectionalChildLongPkListJPA(), TXN_START_END);
  }
View Full Code Here

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

    testAddChildToOneToManyParentWithLongPk(
        new HasOneToManyLongPkListJPA(), new BidirectionalChildLongPkListJPA(), TXN_START_END);
  }
  public void testAddChildToOneToManyParentWithLongPk_NoTxn() throws Exception {
    testAddChildToOneToManyParentWithLongPk(
        new HasOneToManyLongPkListJPA(), new BidirectionalChildLongPkListJPA(), NEW_EM_START_END);
  }
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.