Package com.google.appengine.datanucleus.test.jdo.HasPolymorphicRelationsJDO

Examples of com.google.appengine.datanucleus.test.jdo.HasPolymorphicRelationsJDO.HasOneToManyWithOrderByJDO


    ds.put(pojoEntity);

    startEnd.start();
    registerSubclasses();

    HasOneToManyWithOrderByJDO pojo = pm.getObjectById(
        pojoClass, KeyFactory.keyToString(pojoEntity.getKey()));
    assertNotNull(pojo);
    assertNotNull(pojo.getUndirByStrAndName());
    assertEquals(3, pojo.getUndirByStrAndName().size());
    assertEquals("name 2", pojo.getUndirByStrAndName().get(0).getName());
    assertTrue(pojo.getUndirByStrAndName().get(0) instanceof UnidirTop);
    assertEquals("name 0", pojo.getUndirByStrAndName().get(1).getName());
    assertTrue(pojo.getUndirByStrAndName().get(1) instanceof UnidirMiddle);
    assertEquals("name 1", pojo.getUndirByStrAndName().get(2).getName());
    assertTrue(pojo.getUndirByStrAndName().get(2) instanceof UnidirBottom);

    assertNotNull(pojo.getUnidirByIdAndStr());
    assertEquals(3, pojo.getUnidirByIdAndStr().size());
    assertEquals("name 0", pojo.getUnidirByIdAndStr().get(0).getName());
    assertTrue(pojo.getUnidirByIdAndStr().get(0) instanceof UnidirMiddle);
    assertEquals("name 2", pojo.getUnidirByIdAndStr().get(1).getName());
    assertTrue(pojo.getUnidirByIdAndStr().get(1) instanceof UnidirTop);
    assertEquals("name 1", pojo.getUnidirByIdAndStr().get(2).getName());
    assertTrue(pojo.getUnidirByIdAndStr().get(2) instanceof UnidirBottom);

    assertNotNull(pojo.getUnidirByStrAndId());
    assertEquals(3, pojo.getUnidirByStrAndId().size());
    assertEquals("name 2", pojo.getUnidirByStrAndId().get(0).getName());
    assertTrue(pojo.getUnidirByStrAndId().get(0) instanceof UnidirTop);
    assertEquals("name 1", pojo.getUnidirByStrAndId().get(1).getName());
    assertTrue(pojo.getUnidirByStrAndId().get(1) instanceof UnidirBottom);
    assertEquals("name 0", pojo.getUnidirByStrAndId().get(2).getName());
    assertTrue(pojo.getUnidirByStrAndId().get(2) instanceof UnidirMiddle);

    assertNotNull(pojo.getUnidirWithIndexColumn());
    assertEquals(3, pojo.getUnidirWithIndexColumn().size());
    assertEquals(explicitIndexEntity3.getKey(), KeyFactory.stringToKey(pojo.getUnidirWithIndexColumn().get(0).getId()));
    assertEquals(explicitIndexEntity2.getKey(), KeyFactory.stringToKey(pojo.getUnidirWithIndexColumn().get(1).getId()));
    assertEquals(explicitIndexEntity1.getKey(), KeyFactory.stringToKey(pojo.getUnidirWithIndexColumn().get(2).getId()));

    startEnd.end();
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jdo.HasPolymorphicRelationsJDO.HasOneToManyWithOrderByJDO

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.