Examples of JDBCConfiguration


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

        private EnumSet<UniqueFlag> _unique;
   
   
    @Override
    protected boolean startDelimitedIdentifiers() {
        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        DBDictionary dict = conf.getDBDictionaryInstance();
        dict.setDelimitIdentifiers(true);
        return true;
    }
View Full Code Here

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

    }
    /**
     * Tests that application identity classes are returned correctly.
     */
    public void testSchemaGeneration() {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        DBDictionary dict = conf.getDBDictionaryInstance();
        MappingRepository repos = conf.getMappingRepositoryInstance();
        repos.setStrategyInstaller(new RefreshStrategyInstaller(repos));
        ClassMapping mapping = repos.getMapping(Column.class, null, true);

        Class cls;
        if (dict.getPreferredType(JavaSQLTypes.CLOB) ==  JavaSQLTypes.CLOB) {
View Full Code Here

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

    public void testSmallBLOBs() {
        doBlobTest(50);

        if (getCurrentPlatform() == AbstractTestCase.Platform.ORACLE) {
            OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
            JDBCConfiguration conf = (JDBCConfiguration)
                ((OpenJPAEntityManagerSPI) pm).getConfiguration();
            OracleDictionary dict = (OracleDictionary)
                conf.getDBDictionaryInstance();

            int t = dict.maxEmbeddedBlobSize;
            doBlobTest(t - 1);
            doBlobTest(t);
            doBlobTest(t + 1);
View Full Code Here

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

    public void testSmallCLOBs() {
        doClobTest(50);

        if (getCurrentPlatform() == AbstractTestCase.Platform.ORACLE) {
            OpenJPAEntityManager pm =(OpenJPAEntityManager)currentEntityManager();
            JDBCConfiguration conf = (JDBCConfiguration)
                ((OpenJPAEntityManagerSPI) pm).getConfiguration();
            OracleDictionary dict = (OracleDictionary)
                conf.getDBDictionaryInstance();

            int t = dict.maxEmbeddedClobSize;
            doClobTest(t - 1);
            doClobTest(t);
            doClobTest(t + 1);
View Full Code Here

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

        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 NativeJDBCSeq.run(conf, arguments, opts);
                } finally {
                    conf.close();
                }
            }
        });
        if (!ret)
            System.out.println(_loc.get("native-seq-usage"));
View Full Code Here

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

    {
      super(name);
    }
   
    public void testInverseKeyMapMapping() {
        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping
                (InverseKeyMapPC.class, null, true);
        FieldMapping map = pc.getFieldMapping("helpers");
       
        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping
                (HelperPC.class, null, true);
        FieldMapping str = helper.getFieldMapping("stringField");
       
        assertEquals("stringField", map.getKey().getValueMappedBy());
        assertEquals(str, map.getKey().getValueMappedByMetaData());
View Full Code Here

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

        assertEquals(map.getKeyMapping().getColumns()[0],
                str.getColumns()[0]);
    }
   
    public void testJoinTableMapMapping() {
        JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
        ClassMapping pc = conf.getMappingRepositoryInstance().getMapping
                (JoinTableMapPC.class, null, true);
        FieldMapping map = pc.getFieldMapping("helpers");
       
        ClassMapping helper = conf.getMappingRepositoryInstance().getMapping
                (HelperPC.class, null, true);
        FieldMapping str = helper.getFieldMapping("stringField");
       
        assertEquals("stringField", map.getKey().getValueMappedBy());
        assertEquals(str, map.getKey().getValueMappedByMetaData());
View Full Code Here

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

        DistributedDataSource result = new DistributedDataSource(dataSources);
        return result;
    }
   
    DataSource createDataSource(Slice slice) throws Exception {
        JDBCConfiguration conf = (JDBCConfiguration)slice.getConfiguration();
        DataSource ds = (DataSource)conf.getConnectionFactory();
        if (ds == null) {
            Log log = conf.getConfigurationLog();
            String url = getConnectionInfo(conf);
            if (log.isInfoEnabled())
                log.info(_loc.get("slice-connect", slice, url));
            ds = DataSourceFactory.newDataSource(conf, false);
            DecoratingDataSource dds = new DecoratingDataSource(ds);
            ds = DataSourceFactory.installDBDictionary(
                    conf.getDBDictionaryInstance(), dds, conf, false);
        }
        verifyDataSource(slice, ds, conf);
       
        return ds;
    }
View Full Code Here

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

     * @param key name of the slice to be created
     * @param original a set of properties.
     * @return a newly configured slice
     */
    private Slice newSlice(String key, Map original) {
        JDBCConfiguration child = new JDBCConfigurationImpl();
        child.fromProperties(createSliceProperties(original, key));
        child.setId(getId()+DOT+key);
        setDiagnosticContext(child);
        child.setMappingDefaults(this.getMappingDefaultsInstance());
        child.setDataCacheManager(this.getDataCacheManagerInstance());
        child.setMetaDataRepository(this.getMetaDataRepositoryInstance());
        Slice slice = new Slice(key, child);
        Log log = getConfigurationLog();
        if (log.isTraceEnabled())
            log.trace(_loc.get("slice-configuration", key, child
                    .toProperties(false)));
        return slice;
    }
View Full Code Here

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

        super(test);
    }

    public void setUp()
        throws Exception {
        JDBCConfiguration conf = new JDBCConfigurationImpl();
        conf.setSchemaFactory(DynamicSchemaFactory.class.getName());
        MappingRepository repos = conf.newMappingRepositoryInstance();
        _mapping = repos.getMapping(MappingTest1.class, null, true);
    }
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.