mirror of https://gitee.com/stylefeng/roses
【7.0.4】整理sql适配器
parent
6da65d4954
commit
43f9fc3236
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.db.api.exception.enums;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.constants.DbConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 不同数据库类型的枚举
|
||||
* <p>
|
||||
* 用于标识mapping.xml中不同数据库的标识
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/6/20 21:08
|
||||
*/
|
||||
@Getter
|
||||
public enum DatabaseExceptionEnum implements AbstractExceptionEnum {
|
||||
|
||||
/**
|
||||
* 创建数据库异常
|
||||
*/
|
||||
CREATE_DATABASE_ERROR(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DbConstants.DB_EXCEPTION_STEP_CODE + "01", "创建数据库异常,具体信息:{}"),
|
||||
|
||||
/**
|
||||
* 查询表的所有字段错误
|
||||
*/
|
||||
FIELD_GET_ERROR(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DbConstants.DB_EXCEPTION_STEP_CODE + "02", "查询表的所有字段错误,具体信息:{}"),
|
||||
|
||||
/**
|
||||
* 查询所有表错误
|
||||
*/
|
||||
TABLE_LIST_ERROR(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DbConstants.DB_EXCEPTION_STEP_CODE + "03", "查询所有表错误,具体信息:{}"),
|
||||
|
||||
/**
|
||||
* sql执行错误
|
||||
*/
|
||||
SQL_EXEC_ERROR(RuleConstants.BUSINESS_ERROR_TYPE_CODE + DbConstants.DB_EXCEPTION_STEP_CODE + "04", "sql执行错误,具体信息:{}");
|
||||
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
*/
|
||||
private final String errorCode;
|
||||
|
||||
/**
|
||||
* 提示用户信息
|
||||
*/
|
||||
private final String userTip;
|
||||
|
||||
DatabaseExceptionEnum(String errorCode, String userTip) {
|
||||
this.errorCode = errorCode;
|
||||
this.userTip = userTip;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.pojo.db;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据库信息的封装
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:37
|
||||
*/
|
||||
@Data
|
||||
public class DatabaseInfoDTO {
|
||||
|
||||
/**
|
||||
* jdbc的驱动类型
|
||||
*/
|
||||
private String jdbcDriver;
|
||||
|
||||
/**
|
||||
* jdbc的url
|
||||
*/
|
||||
private String jdbcUrl;
|
||||
|
||||
/**
|
||||
* 数据库连接的账号
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 数据库连接密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.pojo.db;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 字段详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020-01-19-5:40 下午
|
||||
*/
|
||||
@Data
|
||||
public class TableFieldInfo {
|
||||
|
||||
/**
|
||||
* 字段名称(和数据库中的字段名称一致,可能为带下划线的)
|
||||
*/
|
||||
private String columnName;
|
||||
|
||||
/**
|
||||
* 驼峰命名法的名称
|
||||
*/
|
||||
private String camelFieldName;
|
||||
|
||||
/**
|
||||
* 字段注释
|
||||
*/
|
||||
private String columnComment;
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.pojo.db;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 表的基本信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:47
|
||||
*/
|
||||
@Data
|
||||
public class TableInfo {
|
||||
|
||||
/**
|
||||
* 表名称
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 表的注释
|
||||
*/
|
||||
private String tableComment;
|
||||
|
||||
}
|
|
@ -22,12 +22,12 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.db.api.sqladapter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.enums.DbTypeEnum;
|
||||
|
||||
/**
|
||||
* 异构sql获取
|
||||
* 异构sql获取基类,通过继承此类,编写使用不同数据库的sql
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/31 23:44
|
|
@ -22,12 +22,13 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.db.api.sqladapter.database;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 创建数据库的sql
|
||||
* 创建数据库的sql,可用在租户的创建
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2019-07-16-13:06
|
|
@ -22,12 +22,13 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.db.api.sqladapter.database;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 删除数据库的sql
|
||||
* 数据库删除,可用在租户的删除
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/9/4
|
||||
|
@ -54,4 +55,5 @@ public class DropDatabaseSql extends AbstractSql {
|
|||
protected String oracle() {
|
||||
return "DROP DATASPACE ?;";
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.db.api.sqladapter.table;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
|
@ -70,4 +71,5 @@ public class TableFieldListSql extends AbstractSql {
|
|||
protected String oracle() {
|
||||
return "select column_name as columnName, comments as columnComment from user_col_comments where Table_Name= ?";
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.db.api.sqladapter.table;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
|
@ -73,4 +74,5 @@ public class TableListSql extends AbstractSql {
|
|||
"left join user_tab_comments co on ut.table_name = co.table_name\n" +
|
||||
"where tablespace_name is not null and user= ?";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.Reader;
|
||||
import java.sql.Clob;
|
||||
|
||||
/**
|
||||
* oracle数据库转化工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:33
|
||||
*/
|
||||
public class ClobUtil {
|
||||
|
||||
/**
|
||||
* Clob类型转换成String类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:33
|
||||
*/
|
||||
public static String clobToString(final Clob clob) {
|
||||
|
||||
if (clob == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reader reader = null;
|
||||
try {
|
||||
reader = clob.getCharacterStream();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (reader == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
BufferedReader br = new BufferedReader(reader);
|
||||
|
||||
|
||||
String str = null;
|
||||
|
||||
// 读取第一行
|
||||
try {
|
||||
str = br.readLine();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
// 如果没有到达流的末尾,则继续读取下一行
|
||||
while (str != null) {
|
||||
sb.append(str);
|
||||
try {
|
||||
str = br.readLine();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.util;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.exception.DaoException;
|
||||
import cn.stylefeng.roses.kernel.db.api.exception.enums.DatabaseExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.db.DatabaseInfoDTO;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.db.TableFieldInfo;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.db.TableInfo;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.druid.DruidProperties;
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.database.CreateDatabaseSql;
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.table.TableFieldListSql;
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.table.TableListSql;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 数据库操作工具类,可用来获取一些元数据
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:35
|
||||
*/
|
||||
@Slf4j
|
||||
public class DatabaseUtil {
|
||||
|
||||
/**
|
||||
* 查询某个数据库连接的所有表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:35
|
||||
*/
|
||||
public static List<TableInfo> selectTables(DatabaseInfoDTO dbInfo) {
|
||||
List<TableInfo> tables = new ArrayList<>();
|
||||
try {
|
||||
Class.forName(dbInfo.getJdbcDriver());
|
||||
Connection conn = DriverManager.getConnection(
|
||||
dbInfo.getJdbcUrl(), dbInfo.getUsername(), dbInfo.getPassword());
|
||||
|
||||
// 获取数据库名称
|
||||
String dbName = getDbName(dbInfo);
|
||||
|
||||
// 构造查询语句
|
||||
PreparedStatement preparedStatement = conn.prepareStatement(new TableListSql().getSql(dbInfo.getJdbcUrl()));
|
||||
|
||||
// 拼接设置数据库名称
|
||||
if (!dbInfo.getJdbcUrl().contains("sqlserver") && !dbInfo.getJdbcUrl().contains("postgresql")) {
|
||||
preparedStatement.setString(1, dbName);
|
||||
}
|
||||
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
TableInfo tableInfo = new TableInfo();
|
||||
String tableName = resultSet.getString("tableName");
|
||||
String tableComment = resultSet.getString("tableComment");
|
||||
tableInfo.setTableName(tableName);
|
||||
tableInfo.setTableComment(tableComment);
|
||||
tables.add(tableInfo);
|
||||
}
|
||||
return tables;
|
||||
} catch (Exception ex) {
|
||||
log.error("查询所有表错误!", ex);
|
||||
throw new DaoException(DatabaseExceptionEnum.TABLE_LIST_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某个表的所有字段
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @Date 2019-05-04 20:31
|
||||
*/
|
||||
public static List<TableFieldInfo> getTableFields(DatabaseInfoDTO dbInfo, String tableName) {
|
||||
ArrayList<TableFieldInfo> fieldList = new ArrayList<>();
|
||||
try {
|
||||
Class.forName(dbInfo.getJdbcDriver());
|
||||
Connection conn = DriverManager.getConnection(
|
||||
dbInfo.getJdbcUrl(), dbInfo.getUsername(), dbInfo.getPassword());
|
||||
|
||||
PreparedStatement preparedStatement = conn.prepareStatement(new TableFieldListSql().getSql(dbInfo.getJdbcUrl()));
|
||||
|
||||
if (dbInfo.getJdbcUrl().contains("oracle")) {
|
||||
preparedStatement.setString(1, tableName);
|
||||
} else if (dbInfo.getJdbcUrl().contains("postgresql")) {
|
||||
preparedStatement.setString(1, tableName);
|
||||
} else if (dbInfo.getJdbcUrl().contains("sqlserver")) {
|
||||
preparedStatement.setString(1, tableName);
|
||||
} else {
|
||||
String dbName = getDbName(dbInfo);
|
||||
preparedStatement.setString(1, tableName);
|
||||
preparedStatement.setString(2, dbName);
|
||||
}
|
||||
|
||||
//执行查询
|
||||
ResultSet resultSet = preparedStatement.executeQuery();
|
||||
|
||||
while (resultSet.next()) {
|
||||
TableFieldInfo tableFieldInfo = new TableFieldInfo();
|
||||
String columnName = resultSet.getString("columnName");
|
||||
String columnComment = resultSet.getString("columnComment");
|
||||
tableFieldInfo.setColumnName(columnName);
|
||||
tableFieldInfo.setColumnComment(columnComment);
|
||||
tableFieldInfo.setCamelFieldName(StrUtil.toCamelCase(columnName));
|
||||
fieldList.add(tableFieldInfo);
|
||||
}
|
||||
return fieldList;
|
||||
} catch (Exception ex) {
|
||||
log.error("查询表的所有字段错误!", ex);
|
||||
throw new DaoException(DatabaseExceptionEnum.FIELD_GET_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据库
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:39
|
||||
*/
|
||||
public static void createDatabase(DruidProperties druidProperties, String databaseName) {
|
||||
try {
|
||||
Class.forName(druidProperties.getDriverClassName());
|
||||
Connection conn = DriverManager.getConnection(druidProperties.getUrl(), druidProperties.getUsername(), druidProperties.getPassword());
|
||||
|
||||
//创建sql
|
||||
String sql = new CreateDatabaseSql().getSql(druidProperties.getUrl());
|
||||
sql = sql.replaceAll("\\?", databaseName);
|
||||
|
||||
PreparedStatement preparedStatement = conn.prepareStatement(sql);
|
||||
|
||||
int i = preparedStatement.executeUpdate();
|
||||
log.info("创建数据库!数量:" + i);
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("执行sql出现问题!", ex);
|
||||
throw new DaoException(DatabaseExceptionEnum.CREATE_DATABASE_ERROR, ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据库名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:39
|
||||
*/
|
||||
private static String getDbName(DatabaseInfoDTO dbInfo) {
|
||||
|
||||
if (dbInfo.getJdbcUrl().contains("oracle")) {
|
||||
|
||||
// 如果是oracle,直接返回username
|
||||
return dbInfo.getUsername();
|
||||
|
||||
} else if (dbInfo.getJdbcUrl().contains("postgresql")) {
|
||||
|
||||
// postgresql,直接返回最后一个/后边的字符
|
||||
int first = dbInfo.getJdbcUrl().lastIndexOf("/") + 1;
|
||||
return dbInfo.getJdbcUrl().substring(first);
|
||||
|
||||
} else if (dbInfo.getJdbcUrl().contains("sqlserver")) {
|
||||
|
||||
// sqlserver,直接返回最后一个=后边的字符
|
||||
int first = dbInfo.getJdbcUrl().lastIndexOf("=") + 1;
|
||||
return dbInfo.getJdbcUrl().substring(first);
|
||||
|
||||
} else {
|
||||
|
||||
// mysql,返回/和?之间的字符
|
||||
String jdbcUrl = dbInfo.getJdbcUrl();
|
||||
int first = jdbcUrl.lastIndexOf("/") + 1;
|
||||
int last = jdbcUrl.indexOf("?");
|
||||
return jdbcUrl.substring(first, last);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package cn.stylefeng.roses.kernel.db.api.util;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.exception.DaoException;
|
||||
import cn.stylefeng.roses.kernel.db.api.exception.enums.DatabaseExceptionEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.support.EncodedResource;
|
||||
import org.springframework.jdbc.datasource.init.ScriptUtils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
|
||||
/**
|
||||
* sql文件执行
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2019-06-18-17:10
|
||||
*/
|
||||
@Slf4j
|
||||
public class SqlRunUtil {
|
||||
|
||||
/**
|
||||
* 执行sql脚本文件,使用Spring工具类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:52
|
||||
*/
|
||||
public static void runClassPathSql(String classpathFileName, String driverClassName, String url, String username, String password) {
|
||||
try {
|
||||
Class.forName(driverClassName);
|
||||
Connection conn = DriverManager.getConnection(url, username, password);
|
||||
|
||||
ClassPathResource classPathResource = new ClassPathResource(classpathFileName);
|
||||
EncodedResource encodedResource = new EncodedResource(classPathResource, "utf-8");
|
||||
ScriptUtils.executeSqlScript(conn, encodedResource);
|
||||
} catch (Exception e) {
|
||||
log.error("执行sql错误!", e);
|
||||
throw new DaoException(DatabaseExceptionEnum.SQL_EXEC_ERROR, e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行系统路径sql的文件
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/19 10:52
|
||||
*/
|
||||
public static void runFileSystemSql(SqlSessionFactory sqlSessionFactory, String sqlPath) {
|
||||
try {
|
||||
SqlSession sqlSession = sqlSessionFactory.openSession();
|
||||
Connection conn = sqlSession.getConnection();
|
||||
|
||||
FileSystemResource classPathResource = new FileSystemResource(sqlPath);
|
||||
EncodedResource encodedResource = new EncodedResource(classPathResource, "GBK");
|
||||
ScriptUtils.executeSqlScript(conn, encodedResource);
|
||||
} catch (Exception e) {
|
||||
log.error("执行sql错误!", e);
|
||||
throw new DaoException(DatabaseExceptionEnum.SQL_EXEC_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -28,9 +28,9 @@ import cn.hutool.core.date.DateUtil;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.druid.DruidProperties;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.exception.DatasourceContainerException;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqls.AddDatabaseInfoSql;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqls.DatabaseListSql;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqls.DeleteDatabaseInfoSql;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqladapter.AddDatabaseInfoSql;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqladapter.DatabaseListSql;
|
||||
import cn.stylefeng.roses.kernel.dsctn.persist.sqladapter.DeleteDatabaseInfoSql;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqladapter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqladapter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqls;
|
||||
package cn.stylefeng.roses.kernel.dsctn.persist.sqladapter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dict.modular.db.init;
|
||||
package cn.stylefeng.roses.kernel.dict.modular.init;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import cn.stylefeng.roses.kernel.db.init.actuator.DbInitializer;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -33,7 +34,7 @@ import org.springframework.stereotype.Component;
|
|||
*
|
||||
* @author majianguo
|
||||
* @date 2020/12/9 上午11:02
|
||||
* @see cn.stylefeng.roses.kernel.dsctn.persist.sqls.AbstractSql
|
||||
* @see AbstractSql
|
||||
*/
|
||||
@Component
|
||||
public class DictInitializer extends DbInitializer {
|
|
@ -22,8 +22,9 @@
|
|||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.dict.modular.db.init;
|
||||
package cn.stylefeng.roses.kernel.dict.modular.init;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.sqladapter.AbstractSql;
|
||||
import cn.stylefeng.roses.kernel.db.init.actuator.DbInitializer;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -33,7 +34,7 @@ import org.springframework.stereotype.Component;
|
|||
*
|
||||
* @author majianguo
|
||||
* @date 2020/12/9 上午11:02
|
||||
* @see cn.stylefeng.roses.kernel.dsctn.persist.sqls.AbstractSql
|
||||
* @see AbstractSql
|
||||
*/
|
||||
@Component
|
||||
public class DictTypeInitializer extends DbInitializer {
|
Loading…
Reference in New Issue