Package com.alibaba.otter.shared.common.model.config.data.db

Examples of com.alibaba.otter.shared.common.model.config.data.db.DbDataMedia


        dbMediaSource.setPassword("otter");
        dbMediaSource.setUrl("jdbc:mysql://127.0.0.1:3306/retl");
        dbMediaSource.setEncode("UTF-8");
        dbMediaSource.setType(DataMediaType.MYSQL);

        DbDataMedia dataMedia = new DbDataMedia();
        dataMedia.setSource(dbMediaSource);
        dataMedia.setId(1L);
        dataMedia.setName("ljhtable1");
        dataMedia.setNamespace("otter");

        final DbDialect dbDialect = dbDialectFactory.getDbDialect(2L, dataMedia.getSource());
        want.object(dbDialect).clazIs(MysqlDialect.class);

        final TransactionTemplate transactionTemplate = dbDialect.getTransactionTemplate();

        // 插入数据准备
View Full Code Here


            int index = i + 1;
            pair.setId(Long.valueOf(index));
            pair.setPullWeight(count - Long.valueOf(index));
            pair.setPushWeight(count - Long.valueOf(index));

            DbDataMedia mysqlMedia = getMysqlMedia();
            mysqlMedia.setId(2L);
            pair.setSource(mysqlMedia);

            DbDataMedia oracleMedia = getOracleMedia();
            oracleMedia.setId(1L);
            pair.setTarget(oracleMedia);
            pairs.add(pair);
        }
        return pairs;
    }
View Full Code Here

            int index = i + 1;
            pair.setId(Long.valueOf(index));
            pair.setPullWeight(count - Long.valueOf(index));
            pair.setPushWeight(count - Long.valueOf(index));

            DbDataMedia oracleMedia = getOracleMedia();
            oracleMedia.setId(2L);
            pair.setSource(oracleMedia);

            DbDataMedia mysqlMedia = getMysqlMedia();
            mysqlMedia.setId(1L);
            pair.setTarget(mysqlMedia);
            pairs.add(pair);
        }
        return pairs;
    }
View Full Code Here

            DataMediaPair pair = new DataMediaPair();
            pair.setId(Long.valueOf(i));
            pair.setPullWeight(Long.valueOf(i));
            pair.setPushWeight(Long.valueOf(i));

            DbDataMedia mysqlMedia = getMysqlMedia();
            mysqlMedia.setId(Long.valueOf(count + 1));
            pair.setSource(mysqlMedia);

            DbDataMedia oracleMedia = getOracleMedia();
            oracleMedia.setId(Long.valueOf(i));
            pair.setTarget(oracleMedia);
            pairs.add(pair);
        }
        return pairs;
    }
View Full Code Here

    @SpringBeanByName
    private DbDialectFactory dbDialectFactory;

    @Test
    public void testMysqlTable() {
        DbDataMedia mysqlMedia = getMysqlMedia();
        DbDialect dbDialect = dbDialectFactory.getDbDialect(1L, mysqlMedia.getSource());
        Table table = dbDialect.findTable(mysqlMedia.getNamespace(), mysqlMedia.getName());
        want.object(table).notNull();

        System.out.println("tableName = " + table.getName());
        Column[] columns = table.getColumns();
        for (Column column : columns) {
View Full Code Here

    }

    @Test
    public void testOracleTable() {
        DbDataMedia oracleMedia = getOracleMedia();
        DbDialect dbDialect = dbDialectFactory.getDbDialect(1L, oracleMedia.getSource());
        Table table = dbDialect.findTable(oracleMedia.getNamespace(), oracleMedia.getName());
        want.object(table).notNull();

        System.out.println("tableName = " + table.getName());
        Column[] columns = table.getColumns();
        for (Column column : columns) {
View Full Code Here

    private String[]            columnValues       = { "hello", "100.01", "text_b", "text_c", "2011-01-01",
            "2011-01-01 11:11:11", "2011-01-01 11:11:11" };

    @Test(expectedExceptions = RuntimeException.class)
    public void test_mysql() {
        DbDataMedia media = getMysqlMedia();
        final DbDialect dbDialect = dbDialectFactory.getDbDialect(2L, media.getSource());
        want.object(dbDialect).clazIs(MysqlDialect.class);

        final SqlTemplate sqlTemplate = dbDialect.getSqlTemplate();
        final JdbcTemplate jdbcTemplate = dbDialect.getJdbcTemplate();
        final TransactionTemplate transactionTemplate = dbDialect.getTransactionTemplate();
View Full Code Here

    }

    @Test(expectedExceptions = RuntimeException.class)
    public void test_oracle() {
        DbDataMedia media = getOracleMedia();
        final DbDialect dbDialect = dbDialectFactory.getDbDialect(1L, media.getSource());

        want.object(dbDialect).clazIs(OracleDialect.class);
        final SqlTemplate sqlTemplate = dbDialect.getSqlTemplate();
        final JdbcTemplate jdbcTemplate = dbDialect.getJdbcTemplate();
        final TransactionTemplate transactionTemplate = dbDialect.getTransactionTemplate();
View Full Code Here

        pair1.setId(1L);
        pair1.setPipelineId(pipeline.getId());
        pair1.setPullWeight(1L);
        pair1.setPushWeight(1L);

        DbDataMedia mysqlMedia = getMysqlMedia();
        mysqlMedia.setId(1L);
        pair1.setSource(mysqlMedia);

        DbDataMedia oracleMedia = getOracleMedia();
        pair1.setTarget(oracleMedia);
        pairs.add(pair1);
        pipeline.setPairs(pairs);
        PipelineParameter param = new PipelineParameter();
        param.setSyncMode(SyncMode.ROW);
View Full Code Here

        pair1.setId(1L);
        pair1.setPipelineId(pipeline.getId());
        pair1.setPullWeight(1L);
        pair1.setPushWeight(1L);

        DbDataMedia oracleMedia = getOracleMedia();
        oracleMedia.setId(1L);
        pair1.setSource(oracleMedia);

        DbDataMedia mysqlMedia = getMysqlMedia();
        pair1.setTarget(mysqlMedia);

        pairs.add(pair1);
        pipeline.setPairs(pairs);
        PipelineParameter param = new PipelineParameter();
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.config.data.db.DbDataMedia

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.