Package org.apache.openjpa.persistence

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


        //assertDetachedSM (b.getDs ().iterator ().next ());
        assertEquals(4, ((DetachSMPC) pc.getRelSet().iterator().next())
            .getIntField());
        assertEquals(new Integer(100), pc.getStringIntMap().get("b"));

        pm = (OpenJPAEntityManager) factory.createEntityManager();
        startTx(pm);
        pc = (DetachSMPC) pm.merge(pc);
        assertEquals(3, pc.getIntField());
        assertSize(1, pc.getRelSet());
        assertEquals(4, ((DetachSMPC) pc.getRelSet().iterator().next())
View Full Code Here


        assertEquals(2, pc.getStringIntMap().size());
        assertEquals(new Integer(100), pc.getStringIntMap().get("b"));
        endTx(pm);
        endEm(pm);

        pm = (OpenJPAEntityManager) factory.createEntityManager();
        pc = (DetachSMPC) pm.find(DetachSMPC.class, pcoid);
        assertEquals(3, pc.getIntField());
        assertSize(1, pc.getRelSet());
        assertEquals(4, ((DetachSMPC) pc.getRelSet().iterator().next())
            .getIntField());
View Full Code Here

            new ObjectInputStream(
                new ByteArrayInputStream(baos.toByteArray())).readObject();
        assertNotNull("Deserialized OpenJPAEntityManagerFactory is null.",
            pmf2);

        OpenJPAEntityManager pm = pmf2.createEntityManager();
        startTx(pm);
        // go through some objects to make sure our PM is OK
        for (Iterator i = pm.createExtent(RuntimeTest1.class, true).iterator();
            i.hasNext(); i.next())
            ;
View Full Code Here

    public void testInitialValueMutableValueFailures() {
        Map props = new HashMap();
        props.put("openjpa.RestoreMutableValues", "false");
        OpenJPAEntityManagerFactory pmf = getEmf(props);

        OpenJPAEntityManager pm = pmf.createEntityManager();
        RuntimeTest1 rt1 = getObject(pm);

        rt1.getDateField();
        OpenJPAStateManager sm = getStateManager(rt1, pm);
        FieldMetaData fmd = sm.getMetaData().getField("dateField");
View Full Code Here

    @AllowFailure
    public void testInitialValueDate() {
        Map props = new HashMap();
        props.put("openjpa.RestoreState", "all");
        OpenJPAEntityManagerFactory pmf = getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        startTx(pm);
        RuntimeTest1 rt1 = getObject(pm);

        Date d = rt1.getDateField();
View Full Code Here

            new RemoteCommitListenerTestImpl();
        ((OpenJPAEntityManagerFactorySPI) factory).getConfiguration()
            .getRemoteCommitEventManager().addListener(
            transactionListener);

        OpenJPAEntityManager pm = (OpenJPAEntityManager) factory
            .createEntityManager();

        // get an object id
        RuntimeTest1 t1 = new RuntimeTest1("foo", 5);
        startTx(pm);
View Full Code Here

                RemoteCommitProviderTestImpl.class.getName()
                    + "(TransmitPersistedObjectIds=true)");
            propsMap.put("openjpa.DataCache", "true");
            OpenJPAEntityManagerFactory factory = getEmf(propsMap);

            pm = (OpenJPAEntityManager) factory.createEntityManager();
            provider = currentProvider;
        }

        // get an object id
        RuntimeTest1 t1 = new RuntimeTest1("foo", 5);
View Full Code Here

    public void testDurationDifference() {
        // create a non-cluserted, single pmf
        OpenJPAEntityManagerFactory factorySingle = createDistinctFactory(
            null, "");
        EntityManager pmSingle = factorySingle.createEntityManager();

        // Create 2 pmfs that are using RCPTCP. run same benachmark of
        // transactions
        OpenJPAEntityManagerFactory senderFactory1TCP =
            createDistinctFactory(TCPRemoteCommitProvider.class,
View Full Code Here

    public void testLog() {
        Map map = getOrphanedKeyConfiguration("log(Level=FATAL)");

        OpenJPAEntityManagerFactory pmf = getEmf(map);
        OpenJPAEntityManager pm = pmf.createEntityManager();

        BufferedLogFactory logFactory = (BufferedLogFactory)
            ((OpenJPAEntityManagerSPI) pm).getConfiguration().getLogFactory();
        logFactory.clear();
View Full Code Here

    public void testException() {
        Map map = getOrphanedKeyConfiguration("exception");
        OpenJPAEntityManagerFactory pmf = getEmf(map);

        OpenJPAEntityManager pm = pmf.createEntityManager();

        BufferedLogFactory logFactory = (BufferedLogFactory)
            ((OpenJPAEntityManagerSPI) pm).getConfiguration().getLogFactory();
        logFactory.clear();
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.