Package org.apache.openjpa.jdbc.kernel

Examples of org.apache.openjpa.jdbc.kernel.A


    public void testGetObjectId() {
        EntityManagerImpl em = (EntityManagerImpl) emf.createEntityManager();
        Broker broker = em.getBroker();

        em.getTransaction().begin();
        A a = new A();
        em.persist(a);
        Object oidInPersistenceContext = broker.getObjectId(a);
        em.getTransaction().commit();
        em.clear();
        Object oidDetached = broker.getObjectId(a);
        em.close();

        em = (EntityManagerImpl) emf.createEntityManager();
        broker = em.getBroker();
        A a2 = new A();
        a2.setId(a.getId());

        Object oidDetachedNoSm = broker.getObjectId(a2);

        assertTrue(oidInPersistenceContext.equals(oidDetached));
        assertTrue(oidDetached.equals(oidDetachedNoSm));
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.kernel.A

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.