Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.findAll()


    }

    public void testGetObjectsByIdInvocation() {
        OpenJPAEntityManager pm = getPM();
        try {
            Object[] pcs = pm.findAll(Object.class, oids);
            assertEquals(oids.length, pcs.length);
            for (int i = 0; i < oids.length; i++)
                assertEquals(oids[i], pm.getObjectId(pcs[i]));
        } catch (Exception e) {
            bug(1017, e, "getObjectsById() bug");
View Full Code Here


    public void testGetObjectsById() {
        OpenJPAEntityManager pm = getPM();
        ArrayList idlist = new ArrayList();
        idlist.add(_id);
        idlist.add(_id2);
        Collection pcs = pm.findAll(RuntimeTest1.class, idlist);
        assertEquals(2, pcs.size());
        Iterator iter = pcs.iterator();
        assertEquals("STRING", ((RuntimeTest1) iter.next()).getStringField());
        assertEquals("STRING2", ((RuntimeTest2) iter.next()).getStringField());
        endEm(pm);
View Full Code Here

        pm = getPM();
        idlist = new ArrayList();
        idlist.add(_id);
        idlist.add(_id);
        pcs = pm.findAll(RuntimeTest1.class, idlist);
        iter = pcs.iterator();
        assertEquals(2, pcs.size());
        assertEquals("STRING", ((RuntimeTest1) iter.next()).getStringField());
        iter = pcs.iterator();
        assertTrue(iter.next() == iter.next());
View Full Code Here

        pm = getPM();
        idlist = new ArrayList();
        idlist.add(_id);
        idlist.add(invalidId);
        try {
            pcs = (ArrayList) pm.findAll(RuntimeTest1.class, idlist);
            iter = pcs.iterator();
            assertEquals(2, pcs.size());
            assertEquals("STRING",
                ((RuntimeTest1) iter.next()).getStringField());
            assertNotNull(iter.next());
View Full Code Here

            bug(1138, onfe, "Wrong exception type");
        }

        pm = getPM();
        try {
            pm.findAll(RuntimeTest1.class, idlist);
            fail("Found invalid object.");
        } catch (Exception e) {
        }
        endEm(pm);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.