Search in sources :

Example 1 with Qualified2

use of org.apache.cayenne.testdo.qualified.Qualified2 in project cayenne by apache.

the class CDOQualifiedEntitiesIT method testReadToMany.

@Test
public void testReadToMany() throws Exception {
    if (accessStackAdapter.supportsNullBoolean()) {
        createReadToManyDataSet();
        List<Qualified1> roots = ObjectSelect.query(Qualified1.class).select(context);
        assertEquals(1, roots.size());
        Qualified1 root = roots.get(0);
        assertEquals("OX1", root.getName());
        List<Qualified2> related = root.getQualified2s();
        assertEquals(1, related.size());
        Qualified2 r = related.get(0);
        assertEquals("OY1", r.getName());
    }
}
Also used : Qualified1(org.apache.cayenne.testdo.qualified.Qualified1) Qualified2(org.apache.cayenne.testdo.qualified.Qualified2) Test(org.junit.Test)

Example 2 with Qualified2

use of org.apache.cayenne.testdo.qualified.Qualified2 in project cayenne by apache.

the class CDOQualifiedEntitiesIT method testReadToOne.

@Test
public void testReadToOne() throws Exception {
    if (accessStackAdapter.supportsNullBoolean()) {
        createReadToOneDataSet();
        List<Qualified2> roots = ObjectSelect.query(Qualified2.class).select(context);
        assertEquals(1, roots.size());
        Qualified2 root = roots.get(0);
        assertEquals("OY1", root.getName());
        Qualified1 target = root.getQualified1();
        assertNull(target);
    }
}
Also used : Qualified1(org.apache.cayenne.testdo.qualified.Qualified1) Qualified2(org.apache.cayenne.testdo.qualified.Qualified2) Test(org.junit.Test)

Aggregations

Qualified1 (org.apache.cayenne.testdo.qualified.Qualified1)2 Qualified2 (org.apache.cayenne.testdo.qualified.Qualified2)2 Test (org.junit.Test)2