Package org.apache.openjpa.persistence.kernel.common.apps

Examples of org.apache.openjpa.persistence.kernel.common.apps.ProxiesPC


    }

    public void testSQLDate() {
        OpenJPAEntityManager pm = getPM(true, true);
        startTx(pm);
        ProxiesPC pc = pm.find(ProxiesPC.class, _oid);
        java.sql.Date date = pc.getSQLDate();
        assertNotNull(date);

        // dates can lose precision, but make sure same day
        assertEquals(_sqlDate.getYear(), date.getYear());
        assertEquals(_sqlDate.getMonth(), date.getMonth());
        assertEquals(_sqlDate.getDate(), date.getDate());

        // make sure proxied
        assertTrue(!pm.isDirty(pc));
        date.setTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24);
        assertTrue(pm.isDirty(pc));

        endTx(pm);
        assertEquals(date, pc.getSQLDate());
        endEm(pm);
    }
View Full Code Here


    }

    public void testTimestamp() {
        OpenJPAEntityManager pm = getPM(true, true);
        startTx(pm);
        ProxiesPC pc = pm.find(ProxiesPC.class, _oid);
        java.sql.Timestamp tstamp = pc.getTimestamp();
        assertNotNull(tstamp);

        // dates can lose precision, but make sure same day
        assertEquals(_timestamp.getYear(), tstamp.getYear());
        assertEquals(_timestamp.getMonth(), tstamp.getMonth());
        assertEquals(_timestamp.getDate(), tstamp.getDate());

        // make sure proxied
        assertTrue(!pm.isDirty(pc));
        tstamp.setNanos(100);
        assertTrue(pm.isDirty(pc));

        endTx(pm);
        assertEquals(tstamp, pc.getTimestamp());
        endEm(pm);
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.persistence.kernel.common.apps.ProxiesPC

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.