调整包结构

This commit is contained in:
inrgihc
2020-11-30 22:10:31 +08:00
parent def62d9d7e
commit c3a0aeec3e
192 changed files with 593 additions and 735 deletions

View File

@@ -34,10 +34,10 @@
- 源端oracle/SqlServer/MySQL/MariaDB/PostgreSQL/DB2向目的端为PostgreSQL的迁移
- 源端oracle/SqlServer/MySQL/MariaDB/PostgreSQL/DB2向目的端为MySQL/MariaDB的迁移(测试中)
- 源端oracle/SqlServer/MySQL/MariaDB/PostgreSQL/DB2向目的端为MySQL/MariaDB的迁移(**字段类型兼容测试中...**)
- 源端oracle/SqlServer/MySQL/MariaDB/PostgreSQL/DB2向目的端为DB2的迁移(测试中)
- 源端oracle/SqlServer/MySQL/MariaDB/PostgreSQL/DB2向目的端为DB2的迁移(**字段类型兼容测试中...**)
### 4、结构设计
@@ -54,7 +54,7 @@
├── dbswitch-pgwriter // PostgreSQL的二进制写入封装模块
├── dbswitch-dbwriter // 数据库的通用批量Insert封装模块
├── dbswitch-core // 数据库元数据抽取与建表结构语句转换模块
├── dbswitch-sql // 基于calcite的DML语句转换与通用SQL拼接模块
├── dbswitch-sql // 基于calcite的DML语句转换与DDL拼接模块
├── dbswitch-dbcommon // 数据库操作通用封装模块
├── dbswitch-dbchange // 基于全量比对计算变更(变化量)数据模块
├── dbswitch-dbsync // 将dbchange模块计算的变更数据同步入库模块

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.common.constant;
package com.gitee.dbswitch.common.constant;
/**
* 数据库类型的枚举定义

View File

@@ -7,10 +7,10 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.common.util;
package com.gitee.dbswitch.common.util;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
/**
* 普通工具类

View File

@@ -81,7 +81,6 @@
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.constant;
package com.gitee.dbswitch.core.constant;
/**
* 常量定义

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.constant;
package com.gitee.dbswitch.core.constant;
/**
* 数据库表类型:视图表物理表

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database;
package com.gitee.dbswitch.core.database;
import java.util.List;
import java.util.Objects;
@@ -23,12 +23,11 @@ import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.util.JdbcOperatorUtils;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.util.JdbcOperatorUtils;
/**
* 数据库元信息抽象基类

View File

@@ -7,19 +7,19 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database;
package com.gitee.dbswitch.core.database;
import java.util.HashMap;
import java.util.Map;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.impl.DatabaseDB2Impl;
import com.weishao.dbswitch.core.database.impl.DatabaseGreenplumImpl;
import com.weishao.dbswitch.core.database.impl.DatabaseMariaDBImpl;
import com.weishao.dbswitch.core.database.impl.DatabaseMysqlImpl;
import com.weishao.dbswitch.core.database.impl.DatabaseOracleImpl;
import com.weishao.dbswitch.core.database.impl.DatabasePostgresImpl;
import com.weishao.dbswitch.core.database.impl.DatabaseSqlserver2000Impl;
import com.weishao.dbswitch.core.database.impl.DatabaseSqlserverImpl;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.impl.DatabaseDB2Impl;
import com.gitee.dbswitch.core.database.impl.DatabaseGreenplumImpl;
import com.gitee.dbswitch.core.database.impl.DatabaseMariaDBImpl;
import com.gitee.dbswitch.core.database.impl.DatabaseMysqlImpl;
import com.gitee.dbswitch.core.database.impl.DatabaseOracleImpl;
import com.gitee.dbswitch.core.database.impl.DatabasePostgresImpl;
import com.gitee.dbswitch.core.database.impl.DatabaseSqlserver2000Impl;
import com.gitee.dbswitch.core.database.impl.DatabaseSqlserverImpl;
/**
* 数据库实例构建工厂类

View File

@@ -7,12 +7,12 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database;
package com.gitee.dbswitch.core.database;
import java.util.List;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.weishao.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.model.TableDescription;
/**
* 数据库访问通用业务接口

View File

@@ -7,15 +7,15 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
/**
* 支持DB2数据库的元信息实现

View File

@@ -7,16 +7,16 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.util.List;
import com.alibaba.druid.sql.SQLUtils;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
/**
* 支持Greenplum数据库的元信息实现

View File

@@ -7,11 +7,11 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.model.ColumnDescription;
/**
* 支持MariaDB数据库的元信息实现

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.util.List;
import java.util.Map;
@@ -16,16 +16,16 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.core.constant.Const;
import com.gitee.dbswitch.core.constant.Const;
import com.alibaba.druid.sql.SQLUtils;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.util.JdbcOperatorUtils;
import com.weishao.dbswitch.core.util.JdbcUrlUtils;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.util.JdbcOperatorUtils;
import com.gitee.dbswitch.core.util.JdbcUrlUtils;
/**
* 支持MySQL数据库的元信息实现

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -17,14 +17,14 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.alibaba.druid.sql.SQLUtils;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.util.JdbcOperatorUtils;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.util.JdbcOperatorUtils;
/**
* 支持Oracle数据库的元信息实现

View File

@@ -7,16 +7,16 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.util.List;
import com.alibaba.druid.sql.SQLUtils;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
/**
* 支持PostgreSQL数据库的元信息实现

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -15,10 +15,10 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.util.JdbcOperatorUtils;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.util.JdbcOperatorUtils;
/**
* 支持SQLServer2000数据库的元信息实现

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.database.impl;
package com.gitee.dbswitch.core.database.impl;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -18,14 +18,14 @@ import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import com.alibaba.druid.sql.SQLUtils;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.IDatabaseInterface;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.util.JdbcOperatorUtils;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.IDatabaseInterface;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.util.JdbcOperatorUtils;
/**
* 支持SQLServer数据库的元信息实现

View File

@@ -7,9 +7,9 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.model;
package com.gitee.dbswitch.core.model;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
/**
* 数据库列描述符信息定义(Column Description)

View File

@@ -7,10 +7,10 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.model;
package com.gitee.dbswitch.core.model;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
/**
* 数据库表列的元信息

View File

@@ -7,9 +7,9 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.model;
package com.gitee.dbswitch.core.model;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
/**
* 数据库连接描述符信息定义(Database Description)

View File

@@ -7,9 +7,9 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.model;
package com.gitee.dbswitch.core.model;
import com.weishao.dbswitch.core.constant.DBTableType;
import com.gitee.dbswitch.core.constant.DBTableType;
/**
* 数据库表描述符信息定义(Table Description)

View File

@@ -7,12 +7,12 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.service;
package com.gitee.dbswitch.core.service;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.TableDescription;
/**
* 元信息获取接口定义

View File

@@ -7,13 +7,13 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.service;
package com.gitee.dbswitch.core.service;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.DatabaseDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.DatabaseDescription;
import com.gitee.dbswitch.core.model.TableDescription;
/**
* 表结构迁移接口定义

View File

@@ -7,18 +7,18 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.service.impl;
package com.gitee.dbswitch.core.service.impl;
import java.util.List;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.DatabaseFactory;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.DatabaseDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.service.IMigrationService;
import com.weishao.dbswitch.core.util.GenerateSqlUtils;
import com.weishao.dbswitch.core.util.JdbcUrlUtils;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.DatabaseFactory;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.DatabaseDescription;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.service.IMigrationService;
import com.gitee.dbswitch.core.util.GenerateSqlUtils;
import com.gitee.dbswitch.core.util.JdbcUrlUtils;
/**
* 结构迁移转换实现类

View File

@@ -7,17 +7,17 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.service.impl;
package com.gitee.dbswitch.core.service.impl;
import java.util.List;
import java.util.Objects;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.DatabaseFactory;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.service.IMetaDataService;
import com.weishao.dbswitch.core.util.GenerateSqlUtils;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.DatabaseFactory;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.service.IMetaDataService;
import com.gitee.dbswitch.core.util.GenerateSqlUtils;
/**
* 元信息数据迁移实现类

View File

@@ -7,17 +7,17 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.util;
package com.gitee.dbswitch.core.util;
import java.util.List;
import java.util.stream.Collectors;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.core.constant.Const;
import com.weishao.dbswitch.core.database.AbstractDatabase;
import com.weishao.dbswitch.core.database.DatabaseFactory;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.ColumnMetaData;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.core.constant.Const;
import com.gitee.dbswitch.core.database.AbstractDatabase;
import com.gitee.dbswitch.core.database.DatabaseFactory;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.ColumnMetaData;
/**
* 拼接SQL工具类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.util;
package com.gitee.dbswitch.core.util;
import java.sql.Connection;
import java.sql.ResultSet;

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.core.util;
package com.gitee.dbswitch.core.util;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.weishao.dbswitch.core.model.DatabaseDescription;
import com.gitee.dbswitch.core.model.DatabaseDescription;
/**
* JDBC的URL相关工具类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.data;
package com.gitee.dbswitch.data;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
@@ -15,7 +15,7 @@ import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import com.weishao.dbswitch.data.service.MainService;
import com.gitee.dbswitch.data.service.MainService;
/**
* DATA模块启动类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.data.config;
package com.gitee.dbswitch.data.config;
import java.util.ArrayList;
import java.util.Arrays;
@@ -22,8 +22,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.jdbc.core.JdbcTemplate;
import com.weishao.dbswitch.core.service.IMetaDataService;
import com.weishao.dbswitch.core.service.impl.MigrationMetaDataServiceImpl;
import com.gitee.dbswitch.core.service.IMetaDataService;
import com.gitee.dbswitch.core.service.impl.MigrationMetaDataServiceImpl;
/**
* 配置数据属性配置类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.data.service;
package com.gitee.dbswitch.data.service;
import java.sql.ResultSet;
import java.util.ArrayList;
@@ -21,26 +21,26 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.weishao.dbswitch.common.util.CommonUtils;
import com.weishao.dbswitch.core.model.ColumnDescription;
import com.weishao.dbswitch.core.model.TableDescription;
import com.weishao.dbswitch.core.service.IMetaDataService;
import com.weishao.dbswitch.data.config.PropertiesConfig;
import com.weishao.dbswitch.data.util.JdbcTemplateUtils;
import com.weishao.dbswitch.dbchange.ChangeCaculatorService;
import com.weishao.dbswitch.dbchange.IDatabaseChangeCaculator;
import com.weishao.dbswitch.dbchange.IDatabaseRowHandler;
import com.weishao.dbswitch.dbchange.RecordChangeTypeEnum;
import com.weishao.dbswitch.dbchange.pojo.TaskParamBean;
import com.weishao.dbswitch.dbcommon.database.DatabaseOperatorFactory;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.weishao.dbswitch.dbcommon.util.JdbcMetaDataUtils;
import com.weishao.dbswitch.dbsynch.DatabaseSynchronizeFactory;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.weishao.dbswitch.dbwriter.DatabaseWriterFactory;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.util.CommonUtils;
import com.gitee.dbswitch.core.model.ColumnDescription;
import com.gitee.dbswitch.core.model.TableDescription;
import com.gitee.dbswitch.core.service.IMetaDataService;
import com.gitee.dbswitch.data.config.PropertiesConfig;
import com.gitee.dbswitch.data.util.JdbcTemplateUtils;
import com.gitee.dbswitch.dbchange.ChangeCaculatorService;
import com.gitee.dbswitch.dbchange.IDatabaseChangeCaculator;
import com.gitee.dbswitch.dbchange.IDatabaseRowHandler;
import com.gitee.dbswitch.dbchange.RecordChangeTypeEnum;
import com.gitee.dbswitch.dbchange.pojo.TaskParamBean;
import com.gitee.dbswitch.dbcommon.database.DatabaseOperatorFactory;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.util.JdbcMetaDataUtils;
import com.gitee.dbswitch.dbsynch.DatabaseSynchronizeFactory;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbwriter.DatabaseWriterFactory;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.data.util;
package com.gitee.dbswitch.data.util;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -21,7 +21,7 @@ import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ConnectionCallback;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.JdbcUtils;
import com.weishao.dbswitch.common.constant.DatabaseTypeEnum;
import com.gitee.dbswitch.common.constant.DatabaseTypeEnum;
/**
* JdbcTemplate包制使用工具类型

View File

@@ -1,22 +1,22 @@
# source database connection information
## support MySQL/Oracle/SQLServer/PostgreSQL/Greenplum
source.datasource.url= jdbc:mysql://172.17.20.10:3306/data?useUnicode=true&characterEncoding=utf-8&useSSL=true&zeroDateTimeBehavior=convertToNull&nullCatalogMeansCurrent=true
source.datasource.driver-class-name= com.mysql.cj.jdbc.Driver
source.datasource.url= jdbc:oracle:thin:@172.17.2.58:1521:ORCL
source.datasource.driver-class-name= oracle.jdbc.driver.OracleDriver
source.datasource.username= tang
source.datasource.password= tang
# target database connection information
## support MySQL/Oracle/SQLServer/PostgreSQL/Greenplum
target.datasource.url= jdbc:db2://172.17.20.91:50000/testdb
target.datasource.driver-class-name= com.ibm.db2.jcc.DB2Driver
target.datasource.username= db2inst1
target.datasource.password= hangge-1234
target.datasource.url= jdbc:postgresql://172.17.2.10:5432/study
target.datasource.driver-class-name= org.postgresql.Driver
target.datasource.username= tang
target.datasource.password= tang
# source database configuration parameters
## fetch size for query source database
source.datasource-fetch.size=10000
## schema name for query source database
source.datasource-source.schema=data
source.datasource-source.schema=TANG
## table name include from table lists
source.datasource-source.includes=
## table name exclude from table lists
@@ -24,7 +24,7 @@ source.datasource-source.excludes=
# target database configuration parameters
## schema name for create/insert table data
target.datasource-target.schema=NULLID
target.datasource-target.schema=public
## whether drop-create table when target table exist
target.datasource-target.drop=true
## whether create table support auto increment for primary key field

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange;
package com.gitee.dbswitch.dbchange;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -16,13 +16,13 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.util.SerializationUtils;
import com.weishao.dbswitch.dbcommon.constant.Constants;
import com.weishao.dbswitch.dbcommon.database.DatabaseOperatorFactory;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.weishao.dbswitch.dbchange.pojo.TaskParamBean;
import com.weishao.dbswitch.dbchange.util.JdbcTypesUtils;
import com.weishao.dbswitch.dbcommon.util.JdbcMetaDataUtils;
import com.gitee.dbswitch.dbcommon.constant.Constants;
import com.gitee.dbswitch.dbcommon.database.DatabaseOperatorFactory;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbchange.pojo.TaskParamBean;
import com.gitee.dbswitch.dbchange.util.JdbcTypesUtils;
import com.gitee.dbswitch.dbcommon.util.JdbcMetaDataUtils;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;

View File

@@ -7,9 +7,9 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange;
package com.gitee.dbswitch.dbchange;
import com.weishao.dbswitch.dbchange.pojo.TaskParamBean;
import com.gitee.dbswitch.dbchange.pojo.TaskParamBean;
/**
* 变化量计算器接口定义

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange;
package com.gitee.dbswitch.dbchange;
import java.util.List;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange;
package com.gitee.dbswitch.dbchange;
/**
* 记录变化状态枚举类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange.pojo;
package com.gitee.dbswitch.dbchange.pojo;
import lombok.Builder;
import lombok.Data;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbchange.util;
package com.gitee.dbswitch.dbchange.util;
import java.lang.reflect.Field;
import java.sql.Types;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.constant;
package com.gitee.dbswitch.dbcommon.constant;
/**
* 常量值定义

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database;
package com.gitee.dbswitch.dbcommon.database;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -16,8 +16,8 @@ import java.sql.SQLException;
import java.util.Objects;
import javax.sql.DataSource;
import org.springframework.jdbc.support.JdbcUtils;
import com.weishao.dbswitch.dbcommon.constant.Constants;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.constant.Constants;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database;
package com.gitee.dbswitch.dbcommon.database;
import java.util.Map;
import java.lang.reflect.Constructor;
@@ -16,12 +16,12 @@ import javax.sql.DataSource;
import org.springframework.boot.jdbc.DatabaseDriver;
import org.springframework.jdbc.support.JdbcUtils;
import org.springframework.jdbc.support.MetaDataAccessException;
import com.weishao.dbswitch.dbcommon.database.impl.DB2DatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.impl.GreenplumDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.impl.MysqlDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.impl.OracleDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.impl.PostgreSqlDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.impl.SqlServerDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.DB2DatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.GreenplumDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.MysqlDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.OracleDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.PostgreSqlDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.impl.SqlServerDatabaseOperator;
/**
* 数据库操作器构造工厂类

View File

@@ -7,11 +7,11 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database;
package com.gitee.dbswitch.dbcommon.database;
import java.util.List;
import javax.sql.DataSource;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* 数据库操作器接口定义

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* DB2数据库实现类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import javax.sql.DataSource;

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* MySQL数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* Oracle数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* PostgreSQL数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.database.impl;
package com.gitee.dbswitch.dbcommon.database.impl;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.weishao.dbswitch.dbcommon.database.IDatabaseOperator;
import com.weishao.dbswitch.dbcommon.pojo.StatementResultSet;
import com.gitee.dbswitch.dbcommon.database.AbstractDatabaseOperator;
import com.gitee.dbswitch.dbcommon.database.IDatabaseOperator;
import com.gitee.dbswitch.dbcommon.pojo.StatementResultSet;
/**
* SQLServer数据库实现类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.pojo;
package com.gitee.dbswitch.dbcommon.pojo;
import java.sql.Connection;
import java.sql.ResultSet;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.util;
package com.gitee.dbswitch.dbcommon.util;
import javax.sql.DataSource;
import org.springframework.boot.jdbc.DatabaseDriver;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbcommon.util;
package com.gitee.dbswitch.dbcommon.util;
import java.sql.Connection;
import java.sql.DatabaseMetaData;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch;
package com.gitee.dbswitch.dbsynch;
import java.sql.Connection;
import java.sql.ResultSet;

View File

@@ -7,18 +7,18 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch;
package com.gitee.dbswitch.dbsynch;
import java.util.Map;
import java.util.HashMap;
import javax.sql.DataSource;
import com.weishao.dbswitch.dbcommon.util.DatabaseAwareUtils;
import com.weishao.dbswitch.dbsynch.db2.DB2DatabaseSynchImpl;
import com.weishao.dbswitch.dbsynch.mssql.SqlServerDatabaseSynchImpl;
import com.weishao.dbswitch.dbsynch.mysql.MySqlDatabaseSynchImpl;
import com.weishao.dbswitch.dbsynch.oracle.OracleDatabaseSynchImpl;
import com.weishao.dbswitch.dbsynch.pgsql.GreenplumDatabaseSynchImpl;
import com.weishao.dbswitch.dbsynch.pgsql.PostgresqlDatabaseSynchImpl;
import com.gitee.dbswitch.dbcommon.util.DatabaseAwareUtils;
import com.gitee.dbswitch.dbsynch.db2.DB2DatabaseSynchImpl;
import com.gitee.dbswitch.dbsynch.mssql.SqlServerDatabaseSynchImpl;
import com.gitee.dbswitch.dbsynch.mysql.MySqlDatabaseSynchImpl;
import com.gitee.dbswitch.dbsynch.oracle.OracleDatabaseSynchImpl;
import com.gitee.dbswitch.dbsynch.pgsql.GreenplumDatabaseSynchImpl;
import com.gitee.dbswitch.dbsynch.pgsql.PostgresqlDatabaseSynchImpl;
import java.lang.reflect.Constructor;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch;
package com.gitee.dbswitch.dbsynch;
import java.util.List;
import javax.sql.DataSource;

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.db2;
package com.gitee.dbswitch.dbsynch.db2;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* DB2数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.mssql;
package com.gitee.dbswitch.dbsynch.mssql;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* SQLServer数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.mysql;
package com.gitee.dbswitch.dbsynch.mysql;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* MySQL数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.oracle;
package com.gitee.dbswitch.dbsynch.oracle;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* Oracle数据库实现类

View File

@@ -7,10 +7,10 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.pgsql;
package com.gitee.dbswitch.dbsynch.pgsql;
import javax.sql.DataSource;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* Greenplum数据库实现类

View File

@@ -7,14 +7,14 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbsynch.pgsql;
package com.gitee.dbswitch.dbsynch.pgsql;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import com.weishao.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.weishao.dbswitch.dbsynch.IDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.AbstractDatabaseSynchronize;
import com.gitee.dbswitch.dbsynch.IDatabaseSynchronize;
/**
* PostgreSQL数据库实现类

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter;
package com.gitee.dbswitch.dbwriter;
import java.sql.Connection;
import java.sql.ResultSet;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter;
package com.gitee.dbswitch.dbwriter;
import java.util.Map;
import java.util.HashMap;
@@ -30,12 +30,12 @@ public class DatabaseWriterFactory {
private static final long serialVersionUID = 3365136872693503697L;
{
put("MYSQL", "com.weishao.dbswitch.dbwriter.mysql.MySqlWriterImpl");
put("ORACLE", "com.weishao.dbswitch.dbwriter.oracle.OracleWriterImpl");
put("SQLSERVER", "com.weishao.dbswitch.dbwriter.mssql.SqlServerWriterImpl");
put("POSTGRESQL", "com.weishao.dbswitch.dbwriter.gpdb.GreenplumCopyWriterImpl");
put("GREENPLUM", "com.weishao.dbswitch.dbwriter.gpdb.GreenplumCopyWriterImpl");
put("DB2", "com.weishao.dbswitch.dbwriter.db2.DB2WriterImpl");
put("MYSQL", "com.gitee.dbswitch.dbwriter.mysql.MySqlWriterImpl");
put("ORACLE", "com.gitee.dbswitch.dbwriter.oracle.OracleWriterImpl");
put("SQLSERVER", "com.gitee.dbswitch.dbwriter.mssql.SqlServerWriterImpl");
put("POSTGRESQL", "com.gitee.dbswitch.dbwriter.gpdb.GreenplumCopyWriterImpl");
put("GREENPLUM", "com.gitee.dbswitch.dbwriter.gpdb.GreenplumCopyWriterImpl");
put("DB2", "com.gitee.dbswitch.dbwriter.db2.DB2WriterImpl");
}
};
@@ -60,7 +60,7 @@ public class DatabaseWriterFactory {
String type = DatabaseWriterFactory.getDatabaseNameByDataSource(dataSource).toUpperCase();
if (insert) {
if ("POSTGRESQL".equalsIgnoreCase(type) || "GREENPLUM".equalsIgnoreCase(type)) {
return new com.weishao.dbswitch.dbwriter.gpdb.GreenplumInsertWriterImpl(dataSource);
return new com.gitee.dbswitch.dbwriter.gpdb.GreenplumInsertWriterImpl(dataSource);
}
}

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter;
package com.gitee.dbswitch.dbwriter;
import java.util.List;
import javax.sql.DataSource;

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.db2;
package com.gitee.dbswitch.dbwriter.db2;
import java.util.ArrayList;
import java.util.List;
@@ -19,8 +19,8 @@ import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.gpdb;
package com.gitee.dbswitch.dbwriter.gpdb;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
@@ -32,11 +32,11 @@ import javax.sql.DataSource;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ConnectionCallback;
import org.springframework.jdbc.support.JdbcUtils;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import de.bytefish.pgbulkinsert.row.SimpleRow;
import de.bytefish.pgbulkinsert.row.SimpleRowWriter;
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.pgwriter.row.SimpleRow;
import com.gitee.dbswitch.pgwriter.row.SimpleRowWriter;
import com.gitee.dbswitch.pgwriter.util.PostgreSqlUtils;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.gpdb;
package com.gitee.dbswitch.dbwriter.gpdb;
import java.util.ArrayList;
import java.util.List;
@@ -20,8 +20,8 @@ import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.mssql;
package com.gitee.dbswitch.dbwriter.mssql;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -30,8 +30,8 @@ import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.mysql;
package com.gitee.dbswitch.dbwriter.mysql;
import java.sql.Connection;
import java.sql.ResultSet;
@@ -31,8 +31,8 @@ import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -7,7 +7,7 @@
// Data : 2020/1/2
// Location: beijing , china
/////////////////////////////////////////////////////////////
package com.weishao.dbswitch.dbwriter.oracle;
package com.gitee.dbswitch.dbwriter.oracle;
import java.util.List;
import java.util.ArrayList;
@@ -19,8 +19,8 @@ import org.springframework.transaction.TransactionException;
import org.springframework.transaction.TransactionStatus;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import com.weishao.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.weishao.dbswitch.dbwriter.IDatabaseWriter;
import com.gitee.dbswitch.dbwriter.AbstractDatabaseWriter;
import com.gitee.dbswitch.dbwriter.IDatabaseWriter;
import lombok.extern.slf4j.Slf4j;
/**

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert;
package com.gitee.dbswitch.pgwriter;
import org.postgresql.PGConnection;

View File

@@ -1,12 +1,10 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.gitee.dbswitch.pgwriter;
package de.bytefish.pgbulkinsert;
import de.bytefish.pgbulkinsert.configuration.Configuration;
import de.bytefish.pgbulkinsert.configuration.IConfiguration;
import de.bytefish.pgbulkinsert.exceptions.SaveEntityFailedException;
import de.bytefish.pgbulkinsert.mapping.AbstractMapping;
import de.bytefish.pgbulkinsert.pgsql.PgBinaryWriter;
import com.gitee.dbswitch.pgwriter.configuration.Configuration;
import com.gitee.dbswitch.pgwriter.configuration.IConfiguration;
import com.gitee.dbswitch.pgwriter.exceptions.SaveEntityFailedException;
import com.gitee.dbswitch.pgwriter.mapping.AbstractMapping;
import com.gitee.dbswitch.pgwriter.pgsql.PgBinaryWriter;
import org.postgresql.PGConnection;
import org.postgresql.copy.PGCopyOutputStream;

View File

@@ -1,9 +1,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.bulkprocessor;
import de.bytefish.pgbulkinsert.bulkprocessor.handler.IBulkWriteHandler;
package com.gitee.dbswitch.pgwriter.bulkprocessor;
import com.gitee.dbswitch.pgwriter.bulkprocessor.handler.IBulkWriteHandler;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;

View File

@@ -1,11 +1,10 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.bulkprocessor.handler;
package com.gitee.dbswitch.pgwriter.bulkprocessor.handler;
import de.bytefish.pgbulkinsert.IPgBulkInsert;
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
import com.gitee.dbswitch.pgwriter.IPgBulkInsert;
import com.gitee.dbswitch.pgwriter.util.PostgreSqlUtils;
import org.postgresql.PGConnection;
import java.sql.Connection;
import java.util.List;
import java.util.function.Supplier;

View File

@@ -0,0 +1,9 @@
package com.gitee.dbswitch.pgwriter.bulkprocessor.handler;
import java.util.List;
public interface IBulkWriteHandler<TEntity> {
void write(List<TEntity> entities) throws Exception;
}

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.configuration;
package com.gitee.dbswitch.pgwriter.configuration;
public class Configuration implements IConfiguration {

View File

@@ -0,0 +1,7 @@
package com.gitee.dbswitch.pgwriter.configuration;
public interface IConfiguration {
int getBufferSize();
}

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.exceptions;
package com.gitee.dbswitch.pgwriter.exceptions;
public class BinaryWriteFailedException extends RuntimeException {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.exceptions;
package com.gitee.dbswitch.pgwriter.exceptions;
public class PgConnectionException extends RuntimeException {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.exceptions;
package com.gitee.dbswitch.pgwriter.exceptions;
public class SaveEntityFailedException extends RuntimeException {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.exceptions;
package com.gitee.dbswitch.pgwriter.exceptions;
public class ValueHandlerAlreadyRegisteredException extends RuntimeException {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.exceptions;
package com.gitee.dbswitch.pgwriter.exceptions;
public class ValueHandlerNotRegisteredException extends RuntimeException {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.function;
package com.gitee.dbswitch.pgwriter.function;
@FunctionalInterface
public interface ToBooleanFunction<T> {

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.function;
package com.gitee.dbswitch.pgwriter.function;
@FunctionalInterface
public interface ToFloatFunction<T> {

View File

@@ -1,20 +1,17 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.mapping;
import de.bytefish.pgbulkinsert.function.ToBooleanFunction;
import de.bytefish.pgbulkinsert.function.ToFloatFunction;
import de.bytefish.pgbulkinsert.model.ColumnDefinition;
import de.bytefish.pgbulkinsert.model.TableDefinition;
import de.bytefish.pgbulkinsert.pgsql.PgBinaryWriter;
import de.bytefish.pgbulkinsert.pgsql.constants.DataType;
import de.bytefish.pgbulkinsert.pgsql.constants.ObjectIdentifier;
import de.bytefish.pgbulkinsert.pgsql.handlers.*;
import de.bytefish.pgbulkinsert.pgsql.model.geometric.*;
import de.bytefish.pgbulkinsert.pgsql.model.network.MacAddress;
import de.bytefish.pgbulkinsert.pgsql.model.range.Range;
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
package com.gitee.dbswitch.pgwriter.mapping;
import com.gitee.dbswitch.pgwriter.function.ToBooleanFunction;
import com.gitee.dbswitch.pgwriter.function.ToFloatFunction;
import com.gitee.dbswitch.pgwriter.model.ColumnDefinition;
import com.gitee.dbswitch.pgwriter.model.TableDefinition;
import com.gitee.dbswitch.pgwriter.pgsql.PgBinaryWriter;
import com.gitee.dbswitch.pgwriter.pgsql.constants.DataType;
import com.gitee.dbswitch.pgwriter.pgsql.constants.ObjectIdentifier;
import com.gitee.dbswitch.pgwriter.pgsql.handlers.*;
import com.gitee.dbswitch.pgwriter.pgsql.model.geometric.*;
import com.gitee.dbswitch.pgwriter.pgsql.model.network.MacAddress;
import com.gitee.dbswitch.pgwriter.pgsql.model.range.Range;
import com.gitee.dbswitch.pgwriter.util.PostgreSqlUtils;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.time.LocalDate;

View File

@@ -1,10 +1,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.model;
package com.gitee.dbswitch.pgwriter.model;
import java.util.function.BiConsumer;
import de.bytefish.pgbulkinsert.pgsql.PgBinaryWriter;
import com.gitee.dbswitch.pgwriter.pgsql.PgBinaryWriter;
public class ColumnDefinition<TEntity>
{

View File

@@ -1,8 +1,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.gitee.dbswitch.pgwriter.model;
package de.bytefish.pgbulkinsert.model;
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
import com.gitee.dbswitch.pgwriter.util.PostgreSqlUtils;
public class TableDefinition {

View File

@@ -1,10 +1,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql;
import de.bytefish.pgbulkinsert.exceptions.BinaryWriteFailedException;
import de.bytefish.pgbulkinsert.pgsql.handlers.IValueHandler;
package com.gitee.dbswitch.pgwriter.pgsql;
import com.gitee.dbswitch.pgwriter.exceptions.BinaryWriteFailedException;
import com.gitee.dbswitch.pgwriter.pgsql.handlers.IValueHandler;
import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.constants;
package com.gitee.dbswitch.pgwriter.pgsql.constants;
public enum DataType {

View File

@@ -1,11 +1,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.constants;
package com.gitee.dbswitch.pgwriter.pgsql.constants;
import java.util.HashMap;
import java.util.Map;
// https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.h
public class ObjectIdentifier {

View File

@@ -0,0 +1,7 @@
package com.gitee.dbswitch.pgwriter.pgsql.converter;
public interface IValueConverter<TSource, TTarget> {
TTarget convert(TSource source);
}

View File

@@ -1,8 +1,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.gitee.dbswitch.pgwriter.pgsql.converter;
package de.bytefish.pgbulkinsert.pgsql.converter;
import de.bytefish.pgbulkinsert.pgsql.utils.TimeStampUtils;
import com.gitee.dbswitch.pgwriter.pgsql.utils.TimeStampUtils;
import java.time.LocalDate;

View File

@@ -1,8 +1,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.gitee.dbswitch.pgwriter.pgsql.converter;
package de.bytefish.pgbulkinsert.pgsql.converter;
import de.bytefish.pgbulkinsert.pgsql.utils.TimeStampUtils;
import com.gitee.dbswitch.pgwriter.pgsql.utils.TimeStampUtils;
import java.time.LocalDateTime;

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.converter;
package com.gitee.dbswitch.pgwriter.pgsql.converter;
import java.time.LocalTime;

View File

@@ -1,11 +1,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.handlers;
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
import java.io.DataOutputStream;
import java.io.IOException;
import de.bytefish.pgbulkinsert.exceptions.BinaryWriteFailedException;
import com.gitee.dbswitch.pgwriter.exceptions.BinaryWriteFailedException;
public abstract class BaseValueHandler<T> implements IValueHandler<T> {

View File

@@ -1,8 +1,6 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
package de.bytefish.pgbulkinsert.pgsql.handlers;
import de.bytefish.pgbulkinsert.util.BigDecimalUtils;
import com.gitee.dbswitch.pgwriter.util.BigDecimalUtils;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.handlers;
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@@ -1,10 +1,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.handlers;
import de.bytefish.pgbulkinsert.pgsql.handlers.utils.GeometricUtils;
import de.bytefish.pgbulkinsert.pgsql.model.geometric.Box;
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
import com.gitee.dbswitch.pgwriter.pgsql.handlers.utils.GeometricUtils;
import com.gitee.dbswitch.pgwriter.pgsql.model.geometric.Box;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.handlers;
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
import java.io.DataOutputStream;
import java.io.IOException;

View File

@@ -1,6 +1,4 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package de.bytefish.pgbulkinsert.pgsql.handlers;
package com.gitee.dbswitch.pgwriter.pgsql.handlers;
import java.io.DataOutputStream;
import java.io.IOException;

Some files were not shown because too many files have changed in this diff Show More