Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerSPI.addLifecycleListener()


        }

        if (entityManager instanceof OpenJPAEntityManagerSPI) {
            OpenJPAEntityManagerSPI openjpaEM = (OpenJPAEntityManagerSPI) entityManager;
            OpenJPALifecycleListener listener = new OpenJPALifecycleListener();
            openjpaEM.addLifecycleListener(listener, (Class[])null);
            entityManagerListeners.put(entityManager,  listener);
            return;
        }

        Object delegate = entityManager.getDelegate();
View Full Code Here


            final OpenJPAEntityManagerSPI em = emf.createEntityManager();
            final OpenJPAEntityManagerSPI em2 = emf.createEntityManager();
            UniqueLifecycleListener l1 = new UniqueLifecycleListener();
            UniqueLifecycleListener l2 = new UniqueLifecycleListener();
            em.addLifecycleListener(l1, (Class<?>[])null);
            em2.addLifecycleListener(l2, (Class<?>[])null);

            l1.assertCounts(0, 0, 0, 0);
            l2.assertCounts(0, 0, 0, 0);

            em.getTransaction().begin();
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.