Package org.apache.openjpa.persistence

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI.createEntityManager()


                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        OpenJPAEntityManager em = null;
        try {
            // create EM
            em = emf.createEntityManager();
            assertNotNull(em);
            // verify created LifecycleEventManager type
            OpenJPAConfiguration conf = em.getConfiguration();
            assertNotNull(conf);
            assertTrue("ValidationMode",
View Full Code Here


                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        OpenJPAEntityManager em = null;
        try {
            // create EM
            em = emf.createEntityManager();
            assertNotNull(em);
            // verify created LifecycleEventManager type
            OpenJPAConfiguration conf = em.getConfiguration();
            assertNotNull(conf);
            assertTrue("ValidationMode",
View Full Code Here

                props);
        assertNotNull(emf);
        OpenJPAEntityManager em = null;
        try {
            // create EM
            em = emf.createEntityManager();
            assertNotNull(em);
            // verify created LifecycleEventManager type
            OpenJPAConfiguration conf = em.getConfiguration();
            assertNotNull(conf);
            assertTrue("ValidationMode",
View Full Code Here

                props);
        assertNotNull(emf);
        OpenJPAEntityManager em = null;
        try {
            // create EM
            em = emf.createEntityManager();
            assertNotNull(em);
            // verify expected validation config items
            OpenJPAConfiguration conf = em.getConfiguration();
            assertNotNull(conf);
            assertTrue("ValidationMode",
View Full Code Here

 
  public void testPreloadCleanUp() {
        OpenJPAEntityManagerFactorySPI emf = null;
        emf = createNamedEMF(PU_NAME, "openjpa.MetaDataRepository", "Preload=true");
        MetaDataRepository repo = emf.getConfiguration().getMetaDataRepositoryInstance();
        emf.createEntityManager();
        closeEMF(emf);
        assertFalse("The PCRegistry should no longer reference the MetaDataRepository.", PCRegistry
            .removeRegisterClassListener(repo));
    }
View Full Code Here

       
        Object[] props = new Object[] { "openjpa.jdbc.SynchronizeMappings",
            "buildSchema(SchemaAction='drop,add')" };
        OpenJPAEntityManagerFactorySPI oemf = createNamedEMF("TestDropAddSequence",props);
       
        OpenJPAEntityManager em = oemf.createEntityManager();
       
        em.close();
        oemf.close();
    }
   
View Full Code Here

        );

        Long id;

        {
            EntityManager em = emf.createEntityManager();
            EntityTransaction tran = em.getTransaction();
            tran.begin();
            em.createQuery("DELETE from Lecturer as l").executeUpdate();
            em.createQuery("DELETE from Course as c").executeUpdate();
            tran.commit();
View Full Code Here

            em.close();

        }

        {
            EntityManager em = emf.createEntityManager();
            EntityTransaction tran = em.getTransaction();
            tran.begin();

            Course course = new Course();
            LocalizedText objective = new LocalizedText();
View Full Code Here

            tran.commit();
            em.close();
        }

        {
            EntityManager em = emf.createEntityManager();
            Course course = em.find(Course.class, id);
            assertNotNull(course);

            em.close();
        }
View Full Code Here

        String msg;

        {
            msg = "Distinct and Join";
            log.info("\n\n" + msg); // this one does sub-selects for LocalizedString and changeLog
            EntityManager em = emf.createEntityManager();
            EntityTransaction tran = em.getTransaction();
            tran.begin();
            resetSQL();

            Query q = em.createQuery("select distinct c from Course c join  c.lecturers l ");
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.