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

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


    testOnlyOneParentPutOnParentAndChildUpdate(NEW_EM_START_END);
  }
  private void testOnlyOneParentPutOnParentAndChildUpdate(JPATestCase.StartEnd startEnd)
      throws Throwable {
    HasOneToOneJPA pojo = new HasOneToOneJPA();
    HasOneToOneParentJPA hasParent = new HasOneToOneParentJPA();
    PutPolicy policy = setupPutPolicy(pojo, hasParent, startEnd);
    try {
      startEnd.start();
      pojo = em.find(pojo.getClass(), pojo.getId());
      pojo.setStr("another val");
View Full Code Here


  }
  private void testOnlyOneParentPutOnChildDelete(JPATestCase.StartEnd startEnd,
                                                 int expectedPutsOnChildDelete)
      throws Throwable {
    HasOneToOneJPA pojo = new HasOneToOneJPA();
    HasOneToOneParentJPA hasParent = new HasOneToOneParentJPA();
    PutPolicy policy = setupPutPolicy(pojo, hasParent, startEnd);
    try {
      startEnd.start();
      pojo = em.find(pojo.getClass(), pojo.getId());
      pojo.setStr("another val");
View Full Code Here

    HasOneToOneJPA parent = em.find(HasOneToOneJPA.class, key);
    Query q = em.createQuery(
        "select from " + HasOneToOneParentJPA.class.getName() + " c" + " where parent = :p");
    q.setParameter("p", parent);
    q.setFirstResult(1);
    HasOneToOneParentJPA child = (HasOneToOneParentJPA) q.getSingleResult();
    assertEquals(e.getKey(), KeyFactory.stringToKey(child.getId()));
  }
View Full Code Here

    HasOneToOneJPA parent = em.find(HasOneToOneJPA.class, key);
    Query q = em.createQuery(
        "select from " + HasOneToOneParentJPA.class.getName() + " c" + " where parent = :p");
    q.setParameter("p", parent);
    q.setMaxResults(1);
    HasOneToOneParentJPA child = (HasOneToOneParentJPA) q.getSingleResult();
    assertEquals(child1.getKey(), KeyFactory.stringToKey(child.getId()));
  }
View Full Code Here

TOP

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

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.