Examples of EDSQLDateID


Examples of org.apache.openjpa.persistence.derivedid.EDSQLDateID

    }

    public void testDerivedId() throws Exception {
        ClassMetaData cmd = repo.getMetaData(EDSQLDateID.class, null, true);
        try {
            JPAFacadeHelper.toOpenJPAObjectId(cmd, new EDSQLDateID());
            fail("Didn't fail!");
        } catch (UserException re) {
            // expected
        }

        Date d = new Date(2014, 3, 26);
        ESQLDateID id = new ESQLDateID(d);
        EDSQLDateID entity = new EDSQLDateID(id);

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(id);
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        EDSQLDateID persistedEntity = em.find(EDSQLDateID.class, d);
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();

        assertEquals(oid, JPAFacadeHelper.toOpenJPAObjectId(cmd, d));
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.derivedid.EDSQLDateID

    }

    public void testDerivedId() throws Exception {
        ClassMetaData cmd = repo.getMetaData(EDSQLDateID.class, null, true);
        try {
            JPAFacadeHelper.toOpenJPAObjectId(cmd, new EDSQLDateID());
            fail("Didn't fail!");
        } catch (UserException re) {
            // expected

        }
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.