Package org.apache.cayenne.itest

Examples of org.apache.cayenne.itest.ItestTableUtils


import org.apache.cayenne.jpa.itest.ch2.entity.SingleTableInheritanceSuper1;

public class _2_1_10_1_SingleTablePerClassTest extends EntityManagerCase {

    public void testSelectSuper() throws Exception {
        ItestTableUtils helper = getTableHelper("ST_INHERITANCE");
        helper.deleteAll();
        helper.setColumns("id", "objectType", "propertyA", "propertyB", "propertyC");
        helper.insert(1, "A", "1", null, null);
        helper.insert(2, "A", "2", null, null);
        helper.insert(3, "B", "3", "BX", null);
        helper.insert(4, "C", "4", null, "CX");

        Query query = getEntityManager().createQuery(
                "select a FROM SingleTableInheritanceSuper1 a ORDER BY a.propertyA");
        List<?> results = query.getResultList();
        assertEquals(4, results.size());
View Full Code Here


                .getClass()
                .getName());
    }

    public void testSelectSub() throws Exception {
        ItestTableUtils helper = getTableHelper("ST_INHERITANCE");
        helper.deleteAll();
        helper.setColumns("id", "objectType", "propertyA", "propertyB", "propertyC");
        helper.insert(1, "A", "1", null, null);
        helper.insert(2, "A", "2", null, null);
        helper.insert(3, "B", "3", "BX", null);
        helper.insert(4, "C", "4", null, "CX");

        Query query = getEntityManager().createQuery(
                "select a FROM SingleTableInheritanceSub1 a ORDER BY a.propertyA");
        List<?> results = query.getResultList();
        assertEquals(1, results.size());
View Full Code Here

    protected ItestDBUtils getDbHelper() {
        return ItestSetup.getInstance().getDbHelper();
    }
   
    protected ItestTableUtils getTableHelper(String tableName) {
        return new ItestTableUtils(getDbHelper(), tableName);
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.itest.ItestTableUtils

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.