Package org.apache.openjpa.persistence

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


       deleteAll( MappingTest1.class,pm);
       deleteAll( MappingTest2.class,pm);
        endTx(pm);
        pm.close();

        pm = factory.createEntityManager();
        startTx(pm);
        for (int i = 0; i < 10; i++) {
            MappingTest5 pc1 = new MappingTest5();
            pc1.setPk1(i);
            pc1.setPk2(i + 1);
View Full Code Here


        endTx(pm);
        pm.close();

        assertSizes(20, MappingTest5.class);

        pm = factory.createEntityManager();
        startTx(pm);
        deleteAll(MappingTest2.class,pm);
        endTx(pm);
        pm.close();
    }
View Full Code Here

    public void testVirtualSuperclass() {
       
        OpenJPAEntityManagerFactory pmf =(OpenJPAEntityManagerFactory)
                getEmf(getProps());
        OpenJPAEntityManager pm =
            (OpenJPAEntityManager) pmf.createEntityManager();
        //FIXME jthomas
        //Sequence gen = pm.getIdentitySequence(SeqF.class);
        Sequence gen=null;
        long next = ((Number) gen.getIncrement()).longValue();
        //FIXME jthomas
View Full Code Here

        Map props=new HashMap();
        props.put("TableName", "JDO_CLASS_SEQUENCE");
        props.put("IgnoreVirtual", "true");
        OpenJPAEntityManagerFactory pmf =(OpenJPAEntityManagerFactory)
                getEmf(props);
        OpenJPAEntityManager pm = pmf.createEntityManager();
        //FIXME jthomas
        //Sequence gen = pm.getIdentitySequence(SeqF.class);
        Sequence gen =null;
        long next = ((Number) gen.getIncrement()).longValue();
        //FIXME jthomas
View Full Code Here

    }

    public void testNone() {
        Map map = getOrphanedKeyConfiguration("none");
        OpenJPAEntityManagerFactory pmf = getEmf(map);
        OpenJPAEntityManager pm = pmf.createEntityManager();

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

    public void testInMemorySavepointsWithNewInstances() {
        OpenJPAEntityManagerFactory emf1 = createEMF(
            getManagedType(), getSecondaryType(),
            "openjpa.EntityManagerFactoryPool", "true",
            "openjpa.SavepointManager", "in-mem");
        OpenJPAEntityManager em = emf1.createEntityManager();
        OpenJPAEntityManager em2 = null;
        try {
            em.getTransaction().begin();
            T t = newManagedInstance();
            Object orig = getModifiedValue(t);
View Full Code Here

    public void testInMemorySavepointsWithModifiedInstances() {
        OpenJPAEntityManagerFactory emf1 = createEMF(
            getManagedType(), getSecondaryType(),
            "openjpa.EntityManagerFactoryPool", "true",
            "openjpa.SavepointManager", "in-mem");
        OpenJPAEntityManager em = emf1.createEntityManager();
        OpenJPAEntityManager em2 = null;
        try {
            em.getTransaction().begin();
            T t = em.find(getManagedType(), id);
            Object orig = getModifiedValue(t);
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

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.