Package org.apache.art

Examples of org.apache.art.CharPkTestEntity


        q.addOrdering(CharPkTestEntity.OTHER_COL_PROPERTY, Ordering.ASC);

        List pks = context.performQuery(q);
        assertEquals(2, pks.size());

        CharPkTestEntity pk1 = (CharPkTestEntity) pks.get(0);
        assertEquals("n1", pk1.getOtherCol());
        List toMany = (List) pk1.readPropertyDirectly("charFKs");
        assertNotNull(toMany);
        assertFalse(((ValueHolder)toMany).isFault());
        assertEquals(3, toMany.size());

        CharFkTestEntity fk1 = (CharFkTestEntity) toMany.get(0);
View Full Code Here


        deleteTestData();
        ctxt = createDataContext();
    }

    public void testInsert() throws Exception {
        CharPkTestEntity object = (CharPkTestEntity) ctxt.newObject("CharPkTestEntity");
        object.setOtherCol("object-XYZ");
        object.setPkCol("PK1");
        ctxt.commitChanges();

        SQLTemplate q = new SQLTemplate(
                CharPkTestEntity.class,
                "SELECT * FROM CHAR_PK_TEST");
View Full Code Here

        }
        assertEquals("PK1", val);
    }

    public void testDelete() throws Exception {
        CharPkTestEntity object = (CharPkTestEntity) ctxt.newObject("CharPkTestEntity");
        object.setOtherCol("object-XYZ");
        object.setPkCol("PK1");
        ctxt.commitChanges();

        ctxt.deleteObject(object);
        ctxt.commitChanges();
View Full Code Here

        assertNotNull(rows);
        assertEquals(0, rows.size());
    }

    public void testUpdate() throws Exception {
        CharPkTestEntity object = (CharPkTestEntity) ctxt.newObject("CharPkTestEntity");
        object.setOtherCol("object-XYZ");
        object.setPkCol("PK1");
        ctxt.commitChanges();

        object.setOtherCol("UPDATED");
        ctxt.commitChanges();

        SQLTemplate q = new SQLTemplate(
                CharPkTestEntity.class,
                "SELECT * FROM CHAR_PK_TEST");
View Full Code Here

TOP

Related Classes of org.apache.art.CharPkTestEntity

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.