Package org.apache.openjpa.persistence

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


    public void overridePropertyOnEM(String name, String value) {
        // use the default JndiName for the base EntityManagerFactory
        OpenJPAEntityManagerFactorySPI emf1 = (OpenJPAEntityManagerFactorySPI)getEmf(name, defaultJndiName);
        assertNotNull(emf1);
        try {
            OpenJPAEntityManagerSPI em = emf1.createEntityManager();
            assertNotNull(em);

            EntityManager em1 = getEm(emf1, name, value);
            assertNotNull(em1);
View Full Code Here


        MetaDataRepository repos = conf.getMetaDataRepositoryInstance();

        // Force entity resolution
        repos.getMetaData(BaseTestEntity2.class, null, true);
       
        OpenJPAEntityManagerSPI em = emf1.createEntityManager();

        validateOrderColumnNullable(emf1, BaseTestEntity2.class,
            "one2Melems", false);

        validateOrderColumnNullable(emf1, BaseTestEntity2.class,
View Full Code Here

            createEntityManagerFactory("ColDefTest",
            "org/apache/openjpa/persistence/jdbc/order/" +
            "order-persistence-2.xml");

        // Create the EM.  This will spark the mapping tool.
        OpenJPAEntityManagerSPI em = emf1.createEntityManager();       
        //
        // Create a collection using a custom column definition
        validateOrderColumnDef(emf1, ColDefTestEntity.class,
            "one2Mcoldef", "INTEGER");
View Full Code Here

            (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
            createEntityManagerFactory("TableTest",
            "org/apache/openjpa/persistence/jdbc/order/" +
            "order-persistence-5.xml");
       
        OpenJPAEntityManagerSPI em = emf1.createEntityManager();
       
        validateOrderColumnTable(emf1, BaseTestEntity3.class, "one2Melems",
            "xml_o2m_table", "one2MOrder");
                   
        validateOrderColumnTable(emf1, BaseTestEntity3.class, "m2melems",
View Full Code Here

            emf1 = (OpenJPAEntityManagerFactorySPI)OpenJPAPersistence.
                createEntityManagerFactory("ObOcTest",
                    "org/apache/openjpa/persistence/jdbc/order/" +
                    "order-persistence-3.xml");
       
            em = emf1.createEntityManager();
           
            ObOcEntity ent = new ObOcEntity();
            List<Integer> intList = new ArrayList<Integer>();
            intList.add(new Integer(10));
            intList.add(new Integer(20));
View Full Code Here

     * supported.
     * @return true if {@link DBDictionary} supports XML column
     */
    private boolean dictionarySupportsXMLColumn() {
        OpenJPAEntityManagerFactorySPI emf = createEMF();
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
            .getDBDictionaryInstance();
        closeEMF(emf);
        return dict.supportsXMLColumn;
    }
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

        OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI)
        OpenJPAPersistence.createEntityManagerFactory(
                "XMLConstraintPU",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
       
        XMLBase be = new XMLBase();
        try {
            em.getTransaction().begin();
View Full Code Here

        OpenJPAPersistence.createEntityManagerFactory(
                "null-none-mode",
                "org/apache/openjpa/integration/validation/persistence.xml");
        assertNotNull(emf);
        // create EM
        OpenJPAEntityManager em = emf.createEntityManager();
        assertNotNull(em);
        try {
            // verify Validation Mode
            OpenJPAConfiguration conf = em.getConfiguration();
            assertNotNull(conf);
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.