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

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


  public void testAddFetchedParentToBidirChild() throws Exception {
    testAddFetchedParentToBidirChild(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                     TXN_START_END);
  }
  public void testAddFetchedParentToBidirChild_NoTxn() throws Exception {
    testAddFetchedParentToBidirChild(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                     NEW_EM_START_END);
  }
View Full Code Here


    em.remove(parent);
    startEnd.end();
  }

  public void testOnlyOneParentPutOnParentAndChildUpdate() throws Throwable {
    testOnlyOneParentPutOnParentAndChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                               TXN_START_END);
  }
View Full Code Here

  public void testOnlyOneParentPutOnParentAndChildUpdate() throws Throwable {
    testOnlyOneParentPutOnParentAndChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                               TXN_START_END);
  }
  public void testOnlyOneParentPutOnParentAndChildUpdate_NoTxn() throws Throwable {
    testOnlyOneParentPutOnParentAndChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                               NEW_EM_START_END);
  }
View Full Code Here

    testOnlyOneParentPutOnParentAndChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                               NEW_EM_START_END);
  }

  public void testOnlyOnePutOnChildUpdate() throws Throwable {
    testOnlyOnePutOnChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                TXN_START_END);
  }
View Full Code Here

  public void testOnlyOnePutOnChildUpdate() throws Throwable {
    testOnlyOnePutOnChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                TXN_START_END);
  }
  public void testOnlyOnePutOnChildUpdate_NoTxn() throws Throwable {
    testOnlyOnePutOnChildUpdate(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                NEW_EM_START_END);
  }
View Full Code Here

  }

  public void testOnlyOneParentPutOnChildDelete() throws Throwable {
    // 1 put to remove the keys
    int expectedUpdatePuts = 1;
    testOnlyOneParentPutOnChildDelete(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                      TXN_START_END, expectedUpdatePuts);
  }
View Full Code Here

  }

  public void testOnlyOneParentPutOnChildDelete_NoTxn() throws Throwable {
    // updates are atomic when non-tx, so get 1 after each collection clear and 1 for the update.
    int expectedUpdatePuts = 5;
    testOnlyOneParentPutOnChildDelete(new HasOneToManyListJPA(), new BidirectionalChildListJPA(),
                                      NEW_EM_START_END, expectedUpdatePuts);
  }
View Full Code Here

    ds.put(bidirEntity);
    Entity bidirEntity2 =
        new Entity(BidirectionalChildListJPA.class.getSimpleName(), parentEntity.getKey());
    ds.put(bidirEntity2);

    HasOneToManyListJPA parent =
        em.find(HasOneToManyListJPA.class, KeyFactory.keyToString(parentEntity.getKey()));
    Query q = em.createQuery("SELECT FROM " +
                             BidirectionalChildListJPA.class.getName() +
                             " c WHERE parent = :p");
View Full Code Here

    Entity
        bidirEntity2 =
        new Entity(BidirectionalChildListJPA.class.getSimpleName(), parentEntity.getKey());
    ds.put(bidirEntity2);

    HasOneToManyListJPA parent =
        em.find(HasOneToManyListJPA.class, KeyFactory.keyToString(parentEntity.getKey()));
    Query q = em.createQuery("SELECT FROM " +
                             BidirectionalChildListJPA.class.getName() +
                             " c WHERE parent = :p");

    q.setParameter("p", parent.getId());
    @SuppressWarnings("unchecked")
    List<BidirectionalChildListJPA> result = (List<BidirectionalChildListJPA>) q.getResultList();
    assertEquals(2, result.size());
    assertEquals(bidirEntity.getKey(), KeyFactory.stringToKey(result.get(0).getId()));
    assertEquals(bidirEntity2.getKey(), KeyFactory.stringToKey(result.get(1).getId()));
View Full Code Here

TOP

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

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.