Search in sources :

Example 1 with MtTable1Subclass2

use of org.apache.cayenne.testdo.mt.MtTable1Subclass2 in project cayenne by apache.

the class SelectQueryAbstractEntityIT method test2AbstractEntitySelect.

@Test
public void test2AbstractEntitySelect() throws Exception {
    createDataSet();
    SelectQuery<MtTable1> query = new SelectQuery<MtTable1>(MtTable1.class);
    final List<MtTable1> list = context.select(query);
    assertNotNull(list);
    for (MtTable1 sub : list) {
        if (sub instanceof MtTable1Subclass2) {
            assertNotNull(((MtTable1Subclass2) sub).getSubclass2Attribute1());
        }
    }
}
Also used : MtTable1(org.apache.cayenne.testdo.mt.MtTable1) MtTable1Subclass2(org.apache.cayenne.testdo.mt.MtTable1Subclass2) Test(org.junit.Test)

Aggregations

MtTable1 (org.apache.cayenne.testdo.mt.MtTable1)1 MtTable1Subclass2 (org.apache.cayenne.testdo.mt.MtTable1Subclass2)1 Test (org.junit.Test)1