Package org.apache.openjpa.persistence

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


        endEm(pm);
    }

    public void testOptimisticLock() {
        OpenJPAEntityManager pm = getPM();
        AttachB b = (AttachB) pm.find(AttachB.class, oid);

        assertNotNull("b is null in testOptimisticLock", b);

        b = (AttachB) pm.detach(b);
        endEm(pm);
View Full Code Here


        map.put("12", new Integer(12));
        b.setStringIntMap(map);

        pm = getPM();
        startTx(pm);
        AttachB b2 = (AttachB) pm.find(AttachB.class, oid);
        b2.setAint(15);
        endTx(pm);
        endEm(pm);

        pm = getPM();
View Full Code Here

        endEm(pm);
    }

    public void testEmbedded() {
        OpenJPAEntityManager pm = getPM();
        AttachD d = pm.find(AttachD.class, doid);

        assertNotNull("d is null in testEmbedded", d);

        d.getEmbeddedE().getEstr();
        d = (AttachD) pm.detach(d);
View Full Code Here

        assertEquals(5, d2.getEmbeddedE().getEint());
        endTx(pm);
        endEm(pm);

        pm = getPM();
        d2 = (AttachD) pm.find(AttachD.class, doid);

        assertNotNull("d2 is null in testEmbedded", d2);

        assertEquals("E12", d2.getEmbeddedE().getEstr());
        assertEquals(5, d2.getEmbeddedE().getEint());
View Full Code Here

        endEm(pm);
    }

    public void testNullEmbedded() {
        OpenJPAEntityManager pm = getPM();
        AttachD d = (AttachD) pm.find(AttachD.class, doid);

        assertNotNull("d is null in testNullEmbedded", d);
        d.getEmbeddedE().getEstr();
        d = (AttachD) pm.detach(d);
        endEm(pm);
View Full Code Here

        assertNull(d2.getEmbeddedE());
        endTx(pm);
        endEm(pm);

        pm = getPM();
        d2 = (AttachD) pm.find(AttachD.class, doid);

        assertNotNull("d2 is null in testNullEmbedded", d2);
        // no null ind
        if (d2.getEmbeddedE() != null) {
            assertNull(d2.getEmbeddedE().getEstr());
View Full Code Here

        endEm(pm);
    }

    public void testNullEmbeddedRelated() {
        OpenJPAEntityManager pm = getPM();
        AttachD d = (AttachD) pm.find(AttachD.class, doid);

        assertNotNull("d is null in testNullEmbeddedRelated", d);

        d.getEmbeddedE().getEstr();
        d = (AttachD) pm.detach(d);
View Full Code Here

            d2.getEmbeddedE().getEint());
        endTx(pm);
        endEm(pm);

        pm = getPM();
        d2 = (AttachD) pm.find(AttachD.class, doid);
        assertNull("d2.getEmbeddedE().getEstr() is not null",
            d2.getEmbeddedE().getEstr());
        assertEquals("d2.getEmbeddedE().getEint() is not 5", 5,
            d2.getEmbeddedE().getEint());
        endEm(pm);
View Full Code Here

        endEm(pm);
    }

    public void testNullCollection() {
        OpenJPAEntityManager pm = getPM();
        AttachB b = (AttachB) pm.find(AttachB.class, oid);
        b.getDs();
        b = (AttachB) pm.detach(b);
        endEm(pm);

        assertEquals(1, b.getDs().size());
View Full Code Here

        assertNull(b.getDs());
        endTx(pm);
        endEm(pm);

        pm = getPM();
        b = (AttachB) pm.find(AttachB.class, oid);
        assertTrue(b.getDs() == null || b.getDs().size() == 0);
        endEm(pm);
    }

    public void testCollectionAdd() {
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.