Examples of JDBCConfigurationImpl


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

        access, db2, derby, empress, foxpro, h2, hsql, informix, ingres, jdatastore, mysql, oracle, pointbase, postgres,
        sqlserver, sybase
    };

    protected DBType getDBType(EntityManager em) {
        JDBCConfigurationImpl conf = (JDBCConfigurationImpl) getConfiguration(em);
        String dictClassName = getConfiguration(em).getDBDictionaryInstance().getClass().getName();
        String db = conf.dbdictionaryPlugin.alias(dictClassName);
        return DBType.valueOf(db);
    }
View Full Code Here

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

     * For databases that accept only short column names, test avoidance of
     * duplicate column names when populating the table with long column names.
     */
    public void testPopulateWithLongColumnNames() {
        MappingDefaultsImpl mapping = new MappingDefaultsImpl();
        JDBCConfiguration conf = new JDBCConfigurationImpl(false, false);
        conf.setDBDictionary("oracle");
        mapping.setConfiguration(conf);
        Table table = new Table("testtable", null);
        Column[] cols = new Column[3];
        cols[0] = new
            Column("longnamelongnamelongnamelongnamelongnamelongname1", null);
View Full Code Here

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

        access, db2, derby, empress, foxpro, h2, hsql, informix, ingres, jdatastore, mysql, oracle, pointbase, postgres,
        sqlserver, sybase
    };

    protected DBType getDBType(EntityManager em) {
        JDBCConfigurationImpl conf = (JDBCConfigurationImpl) getConfiguration(em);
        String dictClassName = getConfiguration(em).getDBDictionaryInstance().getClass().getName();
        String db = conf.dbdictionaryPlugin.alias(dictClassName);
        return DBType.valueOf(db);
    }
View Full Code Here

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

        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

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

        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

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

        super(test);
    }
   
    public void setUp()
    throws Exception {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        conf.fromProperties(getProperties());
        if (!adjustConfiguration(conf))
            return;
       
        String driver = conf.getConnectionDriverName().toLowerCase();
        String [] sql = null;
       
        if (driver.indexOf("oracle") >= 0) {
            sql = new String []{
                "create sequence seqa_seq",
                "create sequence seqb_seq"
            };
        }
       
        if (sql == null)
            return;
       
        DataSource ds = conf.getDataSource2(null);
        Connection c = ds.getConnection();
        Statement s = null;
        try {
            s = c.createStatement();
            for (int i = 0; i < sql.length; i++) {
View Full Code Here

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

     */
    public void testSequence()
    throws Exception {
        Set set = new HashSet();
       
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        conf.fromProperties(getProperties());
        if (!adjustConfiguration(conf))
            return;
        Thread t1 = new UpdateThread(set, conf);
        Thread t2 = new UpdateThread(set, conf);
       
View Full Code Here

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

        assertEquals(102, set.size());
    }
   
    public void testExtensions()
    throws Exception {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        conf.fromProperties(getProperties());
        if (!adjustConfiguration(conf))
            return;
       
        ClassMapping aMapping = conf.getMappingRepositoryInstance().
                getMapping(SeqA.class, null, true);
        ClassMapping bMapping = conf.getMappingRepositoryInstance().
                getMapping(SeqB.class, null, true);
        ClassMapping cMapping = conf.getMappingRepositoryInstance().
                getMapping(SeqC.class, null, true);
        DataSource ds = conf.getDataSource2(null);
       
        // hold a and c and start b
       
        Seq seq = conf.getSequenceInstance();
        long aid = ((Long) seq.next(_broker, aMapping)).longValue();
        for (int i = 0; i < 5; i++)
            seq.next(_broker, bMapping);
       
        assertEquals(new Long(aid + 1), seq.next(_broker, aMapping));
View Full Code Here

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

        access, db2, derby, empress, foxpro, h2, hsql, informix, ingres, jdatastore, mariadb, mysql, oracle, pointbase,
        postgres, sqlserver, sybase
    };

    protected DBType getDBType(EntityManager em) {
        JDBCConfigurationImpl conf = (JDBCConfigurationImpl) getConfiguration(em);
        String dictClassName = getConfiguration(em).getDBDictionaryInstance().getClass().getName();
        String db = conf.dbdictionaryPlugin.alias(dictClassName);
        return DBType.valueOf(db);
    }
View Full Code Here

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

        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) {
            // START - ALLOW PRINT STATEMENTS
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.