Package org.apache.openjpa.conf

Examples of org.apache.openjpa.conf.Specification


        conf.metaFactoryPlugin.setString(SPEC_JPA.getName());
        conf.lockManagerPlugin.setDefault("mixed");
        conf.lockManagerPlugin.setString("mixed");
        conf.nontransactionalWrite.setDefault("true");
        conf.nontransactionalWrite.set(true);
        Specification spec = ((OpenJPAConfiguration) c).getSpecificationInstance();
        int specVersion = spec.getVersion();
        Compatibility compatibility = conf.getCompatibilityInstance();
        spec.setCompatibility(compatibility);
        if (specVersion < 2) {
            compatibility.setFlushBeforeDetach(true);
            compatibility.setCopyOnDetach(true);
            compatibility.setPrivatePersistentProperties(true);
            compatibility.setIgnoreDetachedStateFieldForProxySerialization(true);
View Full Code Here


            assertTrue(compat.getCopyOnDetach());
            assertTrue(compat.getIgnoreDetachedStateFieldForProxySerialization());
            assertTrue(compat.getPrivatePersistentProperties());
            String vMode = emf.getConfiguration().getValidationMode();
            assertEquals("NONE", vMode);
            Specification spec = emf.getConfiguration().getSpecificationInstance();
            assertEquals("JPA", spec.getName().toUpperCase());
            assertEquals(spec.getVersion(), 1);
        } finally {
            closeEMF(emf);
        }
    }
View Full Code Here

            assertFalse(compat.getCopyOnDetach());
            assertFalse(compat.getIgnoreDetachedStateFieldForProxySerialization());
            assertFalse(compat.getPrivatePersistentProperties());
            String vMode = emf.getConfiguration().getValidationMode();
            assertEquals("AUTO", vMode);
            Specification spec = emf.getConfiguration().getSpecificationInstance();
            assertEquals("JPA", spec.getName().toUpperCase());
            assertEquals(spec.getVersion(), 2);
        } finally {
            closeEMF(emf);
        }
    }
View Full Code Here

        assertTrue(compat.getPrivatePersistentProperties());
        assertFalse(compat.isAbstractMappingUniDirectional());
        assertFalse(compat.isNonDefaultMappingAllowed());
        String vMode = emf1.getConfiguration().getValidationMode();
        assertEquals("NONE", vMode);
        Specification spec = emf1.getConfiguration().getSpecificationInstance();
        assertEquals("JPA", spec.getName().toUpperCase());
        assertEquals(spec.getVersion(), 1);
       
        closeEMF(emf1);

    }
View Full Code Here

        assertFalse(compat.getPrivatePersistentProperties());
        assertTrue(compat.isAbstractMappingUniDirectional());
        assertTrue(compat.isNonDefaultMappingAllowed());
        String vMode = emf.getConfiguration().getValidationMode();
        assertEquals("AUTO", vMode);
        Specification spec = emf.getConfiguration().getSpecificationInstance();
        assertEquals("JPA", spec.getName().toUpperCase());
        assertEquals(spec.getVersion(), 2);
    }
View Full Code Here

        assertTrue(compat.getPrivatePersistentProperties());
        assertFalse(compat.isAbstractMappingUniDirectional());
        assertFalse(compat.isNonDefaultMappingAllowed());
        String vMode = emf1.getConfiguration().getValidationMode();
        assertEquals("NONE", vMode);
        Specification spec = emf1.getConfiguration().getSpecificationInstance();
        assertEquals("JPA", spec.getName().toUpperCase());
        assertEquals(spec.getVersion(), 1);
       
        closeEMF(emf1);

    }
View Full Code Here

        assertFalse(compat.getPrivatePersistentProperties());
        assertTrue(compat.isAbstractMappingUniDirectional());
        assertTrue(compat.isNonDefaultMappingAllowed());
        String vMode = emf.getConfiguration().getValidationMode();
        assertEquals("AUTO", vMode);
        Specification spec = emf.getConfiguration().getSpecificationInstance();
        assertEquals("JPA", spec.getName().toUpperCase());
        assertEquals(spec.getVersion(), 2);
    }
View Full Code Here

        }
        if (!(c instanceof JDBCConfigurationImpl))
            return false;

        JDBCConfigurationImpl conf = (JDBCConfigurationImpl) c;
        Specification jpa = PersistenceProductDerivation.SPEC_JPA;
        Specification ejb = PersistenceProductDerivation.ALIAS_EJB;

        conf.metaFactoryPlugin.setAlias(ejb.getName(),
            PersistenceMappingFactory.class.getName());
        conf.metaFactoryPlugin.setAlias(jpa.getName(),
            PersistenceMappingFactory.class.getName());

        conf.mappingFactoryPlugin.setAlias(ejb.getName(),
            PersistenceMappingFactory.class.getName());
        conf.mappingFactoryPlugin.setAlias(jpa.getName(),
            PersistenceMappingFactory.class.getName());

        conf.mappingDefaultsPlugin.setAlias(ejb.getName(),
            PersistenceMappingDefaults.class.getName());
        conf.mappingDefaultsPlugin.setAlias(jpa.getName(),
            PersistenceMappingDefaults.class.getName());
       
        conf.lockManagerPlugin.setAlias("mixed", "org.apache.openjpa.jdbc.kernel.MixedLockManager");
View Full Code Here

    @Override
    public boolean afterSpecificationSet(Configuration c) {
        if (!(c instanceof JDBCConfigurationImpl))
            return false;
        JDBCConfigurationImpl conf = (JDBCConfigurationImpl) c;
        Specification jpa = PersistenceProductDerivation.SPEC_JPA;
        if (!jpa.getName().equals(conf.getSpecificationInstance().getName()))
            return false;
       
        conf.mappingDefaultsPlugin.setDefault(jpa.getName());
        conf.mappingDefaultsPlugin.setString(jpa.getName());
        conf.lockManagerPlugin.setDefault("mixed");
        conf.lockManagerPlugin.setString("mixed");
        return true;
    }
View Full Code Here

        OpenJPAConfigurationImpl conf = (OpenJPAConfigurationImpl) c;
        conf.metaFactoryPlugin.setDefault(SPEC_JPA.getName());
        conf.metaFactoryPlugin.setString(SPEC_JPA.getName());
        conf.nontransactionalWrite.setDefault("true");
        conf.nontransactionalWrite.set(true);
        Specification spec = ((OpenJPAConfiguration) c).getSpecificationInstance();
        int specVersion = spec.getVersion();
        Compatibility compatibility = conf.getCompatibilityInstance();
        spec.setCompatibility(compatibility);
        if (specVersion < 2) {
            compatibility.setFlushBeforeDetach(true);
            compatibility.setCopyOnDetach(true);
            compatibility.setPrivatePersistentProperties(true);
            compatibility.setIgnoreDetachedStateFieldForProxySerialization(true);
View Full Code Here

TOP

Related Classes of org.apache.openjpa.conf.Specification

Copyright © 2018 www.massapicom. 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.