Package org.apache.openjpa.jdbc.conf

Examples of org.apache.openjpa.jdbc.conf.JDBCConfiguration


    @Override
    public void setUp() throws Exception {
        super.setUp(Person.class, CLEAR_TABLES);
        OpenJPAEntityManager em = emf.createEntityManager();
        JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
        String user = conf.getConnectionUserName();
        if (user != null && !user.equals("")) {
            // Disable for non-Derby, due to connectionUserName to schema mapping failures
            setTestsDisabled(true);
            getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");
        } else {
View Full Code Here


    }
   
    public void endConfiguration() {
        super.endConfiguration();

        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        _dict = conf.getDBDictionaryInstance();
        if (_defaults == null)
            _defaults = conf.getMappingDefaultsInstance();
        if (_schema != null && _schema instanceof Configurable) {
            ((Configurable) _schema).setConfiguration(conf);
            ((Configurable) _schema).startConfiguration();
            ((Configurable) _schema).endConfiguration();
        }           
View Full Code Here

        // pointbase doesn't really lock
        if (getCurrentPlatform() == AbstractTestCase.Platform.POINTBASE)
            return true;

        if (getConfiguration() instanceof JDBCConfiguration) {
            JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
            return !conf.getDBDictionaryInstance().supportsSelectForUpdate;
        }
        return false;
    }
View Full Code Here

        super(conf);
        _conf = conf;
    }
   
    public static DummyBrokerFactory newInstance(ConfigurationProvider cp) {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        cp.setInto(conf);
        return new DummyBrokerFactory(conf);
    }  
View Full Code Here

    }

    public void setUp() throws SQLException {
        OpenJPAEntityManagerFactorySPI emf = createEMF();

        JDBCConfiguration conf = ((JDBCConfiguration) emf.getConfiguration());
        DBDictionary dict = conf.getDBDictionaryInstance();

        if (skipTest(dict)) {
            emf.close();
            return;
        }

        // the mapping tool doesn't handle creating XML columns that map to strings
        // build table manually
        Connection con = ((DataSource) conf.getConnectionFactory()).getConnection();
        Statement stmt = con.createStatement();
        String ddl = "DROP TABLE XmlColEntity";
        try {
            stmt.execute(ddl);
            con.commit();
View Full Code Here

        OpenJPAEntityManagerFactorySPI emf =
            createEMF(XmlColEntity.class,
                "openjpa.jdbc.SchemaFactory", "native",
                "openjpa.jdbc.SynchronizeMappings""");

        JDBCConfiguration conf = ((JDBCConfiguration) emf.getConfiguration());
        DBDictionary dict = conf.getDBDictionaryInstance();

        if (skipTest(dict)) {
            emf.close();
            return;
        }
View Full Code Here

        OpenJPAEntityManagerFactorySPI emf =
            createEMF(XmlColEntity.class,
                "openjpa.jdbc.SchemaFactory", "native",
                "openjpa.jdbc.SynchronizeMappings""");

        JDBCConfiguration conf = ((JDBCConfiguration) emf.getConfiguration());
        DBDictionary dict = conf.getDBDictionaryInstance();

        if (skipTest(dict)) {
            emf.close();
            return;
        }
View Full Code Here

        Options opts = new Options();
        final String[] arguments = opts.setFromCmdLine(args);
        boolean ret = Configurations.runAgainstAllAnchors(opts,
            new Configurations.Runnable() {
            public boolean run(Options opts) throws Exception {
                JDBCConfiguration conf = new JDBCConfigurationImpl();
                try {
                    return TableSchemaFactory.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret)
            System.out.println(_loc.get("sch-usage"));
View Full Code Here

        config.putAll(map);
        return (OpenJPAEntityManagerFactorySPI) Persistence.createEntityManagerFactory("test", config);
    }

    void setDictionary() {
        JDBCConfiguration conf = (JDBCConfiguration) getEntityManagerFactory().getConfiguration();
        dict = conf.getDBDictionaryInstance();
        if (dict instanceof DerbyDictionary || dict instanceof HSQLDictionary) {
            dict.requiresCastForComparisons = false;
            dict.requiresCastForMathFunctions = false;
        } else if (dict instanceof OracleDictionary) {
            dict.setJoinSyntax("sql92");
View Full Code Here

                "openjpa.jdbc.DBDictionary", batchLimit,
                "openjpa.ConnectionFactoryProperties", "PrintParameters=true",
                CLEAR_TABLES);

        assertNotNull("Unable to create EntityManagerFactory", emf);
        JDBCConfiguration conf = (JDBCConfiguration) emf.getConfiguration();
        DBDictionary dict = conf.getDBDictionaryInstance();
        isOracle = dict instanceof OracleDictionary;
        return emf;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.conf.JDBCConfiguration

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.