Search in sources :

Example 6 with SqlToyContext

use of org.sagacity.sqltoy.SqlToyContext in project sagacity-sqltoy by chenrenfei.

the class DialectFactory method deleteAll.

/**
 * @todo 批量删除对象
 * @param sqlToyContext
 * @param entities
 * @param batchSize
 * @param dataSource
 * @param autoCommit
 * @throws Exception
 */
public Long deleteAll(final SqlToyContext sqlToyContext, final List<?> entities, final int batchSize, final DataSource dataSource, final Boolean autoCommit) throws Exception {
    if (entities == null || entities.isEmpty())
        return new Long(0);
    try {
        // 分库分表并行执行
        List<Long> result = ParallelUtils.execute(sqlToyContext, entities, false, dataSource, new ParallelCallbackHandler() {

            public List execute(SqlToyContext sqlToyContext, ShardingGroupModel batchModel) throws Exception {
                final ShardingModel shardingModel = batchModel.getShardingModel();
                Long updateCnt = (Long) DataSourceUtils.processDataSource(sqlToyContext, shardingModel.getDataSource(), new DataSourceCallbackHandler() {

                    public void doConnection(Connection conn, Integer dbType, String dialect) throws Exception {
                        this.setResult(getDialectSqlWrapper(dbType).deleteAll(sqlToyContext, batchModel.getEntities(), batchSize, conn, autoCommit, shardingModel.getTableName()));
                    }
                });
                List<Long> tmp = new ArrayList();
                tmp.add(updateCnt);
                return tmp;
            }
        });
        long updateTotalCnt = 0;
        if (result != null) {
            for (Long cnt : result) {
                updateTotalCnt = updateTotalCnt + cnt.longValue();
            }
        }
        return new Long(updateTotalCnt);
    } catch (Exception e) {
        SqlExecuteStat.error(e);
        throw e;
    } finally {
        SqlExecuteStat.destroy();
    }
}
Also used : ParallelCallbackHandler(org.sagacity.sqltoy.callback.ParallelCallbackHandler) Connection(java.sql.Connection) ArrayList(java.util.ArrayList) ShardingGroupModel(org.sagacity.sqltoy.model.ShardingGroupModel) BaseException(org.sagacity.sqltoy.exception.BaseException) DataSourceCallbackHandler(org.sagacity.sqltoy.callback.DataSourceCallbackHandler) List(java.util.List) ArrayList(java.util.ArrayList) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) ShardingModel(org.sagacity.sqltoy.model.ShardingModel)

Example 7 with SqlToyContext

use of org.sagacity.sqltoy.SqlToyContext in project sagacity-sqltoy by chenrenfei.

the class DialectFactory method loadAll.

/**
 * @todo 批量加载集合(自4.13.1 版本已经自动将超大规模集合拆分执行),规避了jpa等框架的缺陷
 * @param sqlToyContext
 * @param entities
 * @param cascadeTypes
 * @param lockMode
 * @param dataSource
 * @return
 */
public <T extends Serializable> List<T> loadAll(final SqlToyContext sqlToyContext, final List<T> entities, final Class[] cascadeTypes, final LockMode lockMode, final DataSource dataSource) {
    if (entities == null || entities.isEmpty()) {
        logger.warn("loadAll entities is null or empty,please check!");
        return entities;
    }
    try {
        SqlExecuteStat.start(BeanUtil.getEntityClass(entities.get(0).getClass()).getName(), "loadAll:[" + entities.size() + "]条记录!", null);
        // 一般in的最大数量是1000
        int batchSize = SqlToyConstants.getLoadAllBatchSize();
        // 对可能存在的配置参数定义错误进行校正,最大控制在1000内
        if (batchSize > 1000 || batchSize < 1) {
            batchSize = 1000;
        }
        int totalSize = entities.size();
        int batch = (totalSize + batchSize - 1) / batchSize;
        List result = new ArrayList();
        List batchEntities;
        for (int i = 0; i < batch; i++) {
            // 切取单个批次的记录
            batchEntities = entities.subList(i * batchSize, (i == batch - 1) ? totalSize : (i + 1) * batchSize);
            // 分库分表并行执行,并返回结果
            result.addAll(ParallelUtils.execute(sqlToyContext, batchEntities, false, dataSource, (context, batchModel) -> {
                ShardingModel shardingModel = batchModel.getShardingModel();
                return (List) DataSourceUtils.processDataSource(context, shardingModel.getDataSource(), new DataSourceCallbackHandler() {

                    @Override
                    public void doConnection(Connection conn, Integer dbType, String dialect) throws Exception {
                        this.setResult(getDialectSqlWrapper(dbType).loadAll(context, batchModel.getEntities(), (cascadeTypes == null) ? null : CollectionUtil.arrayToList(cascadeTypes), lockMode, conn, dbType, dialect, shardingModel.getTableName(), getFetchSize(-1), -1));
                    }
                });
            }));
        }
        SqlExecuteStat.debug("执行结果", "查询结果记录:{} 条!", result.size());
        return result;
    } catch (Exception e) {
        SqlExecuteStat.error(e);
        throw new DataAccessException(e);
    } finally {
        SqlExecuteStat.destroy();
    }
}
Also used : SqlServerDialect(org.sagacity.sqltoy.dialect.impl.SqlServerDialect) EntityMeta(org.sagacity.sqltoy.config.model.EntityMeta) PageOptimizeUtils(org.sagacity.sqltoy.dialect.utils.PageOptimizeUtils) ResultUtils(org.sagacity.sqltoy.utils.ResultUtils) Connection(java.sql.Connection) GuassDBDialect(org.sagacity.sqltoy.dialect.impl.GuassDBDialect) SqlParamsModel(org.sagacity.sqltoy.config.model.SqlParamsModel) LoggerFactory(org.slf4j.LoggerFactory) SqlUtil(org.sagacity.sqltoy.utils.SqlUtil) PostgreSqlDialect(org.sagacity.sqltoy.dialect.impl.PostgreSqlDialect) DataSourceCallbackHandler(org.sagacity.sqltoy.callback.DataSourceCallbackHandler) TreeTableModel(org.sagacity.sqltoy.model.TreeTableModel) OceanBaseDialect(org.sagacity.sqltoy.dialect.impl.OceanBaseDialect) Map(java.util.Map) CollectionUtil(org.sagacity.sqltoy.utils.CollectionUtil) KingbaseDialect(org.sagacity.sqltoy.dialect.impl.KingbaseDialect) Oracle11gDialect(org.sagacity.sqltoy.dialect.impl.Oracle11gDialect) DecryptHandler(org.sagacity.sqltoy.callback.DecryptHandler) SqlUtilsExt(org.sagacity.sqltoy.utils.SqlUtilsExt) SqlConfigParseUtils(org.sagacity.sqltoy.config.SqlConfigParseUtils) QueryResult(org.sagacity.sqltoy.model.QueryResult) SqlWithAnalysis(org.sagacity.sqltoy.config.model.SqlWithAnalysis) PageOptimize(org.sagacity.sqltoy.config.model.PageOptimize) SqliteDialect(org.sagacity.sqltoy.dialect.impl.SqliteDialect) Executors(java.util.concurrent.Executors) Serializable(java.io.Serializable) QueryExecutor(org.sagacity.sqltoy.model.QueryExecutor) List(java.util.List) StoreResult(org.sagacity.sqltoy.model.StoreResult) Type(java.lang.reflect.Type) DB2Dialect(org.sagacity.sqltoy.dialect.impl.DB2Dialect) ParallelUtils(org.sagacity.sqltoy.utils.ParallelUtils) Pattern(java.util.regex.Pattern) QueryExecutorExtend(org.sagacity.sqltoy.model.inner.QueryExecutorExtend) DefaultDialect(org.sagacity.sqltoy.dialect.impl.DefaultDialect) UpdateRowHandler(org.sagacity.sqltoy.callback.UpdateRowHandler) DMDialect(org.sagacity.sqltoy.dialect.impl.DMDialect) HashMap(java.util.HashMap) DataAccessException(org.sagacity.sqltoy.exception.DataAccessException) SqlExecuteStat(org.sagacity.sqltoy.SqlExecuteStat) ArrayList(java.util.ArrayList) QueryExecutorBuilder(org.sagacity.sqltoy.utils.QueryExecutorBuilder) FieldMeta(org.sagacity.sqltoy.config.model.FieldMeta) ShardingUtils(org.sagacity.sqltoy.plugins.sharding.ShardingUtils) SqlExecuteTrace(org.sagacity.sqltoy.config.model.SqlExecuteTrace) DataSource(javax.sql.DataSource) FieldsSecureProvider(org.sagacity.sqltoy.plugins.secure.FieldsSecureProvider) ShardingModel(org.sagacity.sqltoy.config.model.ShardingModel) TableMeta(org.sagacity.sqltoy.model.TableMeta) ExecutorService(java.util.concurrent.ExecutorService) MySqlDialect(org.sagacity.sqltoy.dialect.impl.MySqlDialect) Logger(org.slf4j.Logger) ReflectPropsHandler(org.sagacity.sqltoy.callback.ReflectPropsHandler) SqlToyConfig(org.sagacity.sqltoy.config.model.SqlToyConfig) StringUtil(org.sagacity.sqltoy.utils.StringUtil) ImpalaDialect(org.sagacity.sqltoy.dialect.impl.ImpalaDialect) OracleDialect(org.sagacity.sqltoy.dialect.impl.OracleDialect) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) DBType(org.sagacity.sqltoy.utils.DataSourceUtils.DBType) DataSourceUtils(org.sagacity.sqltoy.utils.DataSourceUtils) TimeUnit(java.util.concurrent.TimeUnit) DialectUtils(org.sagacity.sqltoy.dialect.utils.DialectUtils) SqlToyResult(org.sagacity.sqltoy.config.model.SqlToyResult) UniqueExecutor(org.sagacity.sqltoy.model.UniqueExecutor) InsertRowCallbackHandler(org.sagacity.sqltoy.callback.InsertRowCallbackHandler) BeanUtil(org.sagacity.sqltoy.utils.BeanUtil) LockMode(org.sagacity.sqltoy.model.LockMode) TidbDialect(org.sagacity.sqltoy.dialect.impl.TidbDialect) ColumnMeta(org.sagacity.sqltoy.model.ColumnMeta) SqlToyConstants(org.sagacity.sqltoy.SqlToyConstants) ClickHouseDialect(org.sagacity.sqltoy.dialect.impl.ClickHouseDialect) ArrayList(java.util.ArrayList) Connection(java.sql.Connection) List(java.util.List) ArrayList(java.util.ArrayList) DataSourceCallbackHandler(org.sagacity.sqltoy.callback.DataSourceCallbackHandler) DataAccessException(org.sagacity.sqltoy.exception.DataAccessException) DataAccessException(org.sagacity.sqltoy.exception.DataAccessException) ShardingModel(org.sagacity.sqltoy.config.model.ShardingModel)

Example 8 with SqlToyContext

use of org.sagacity.sqltoy.SqlToyContext in project sagacity-sqltoy by chenrenfei.

the class MapperUtilsTest method testPOTOVO.

@Test
public void testPOTOVO() {
    StaffInfo staffInfo = new StaffInfo();
    staffInfo.setStaffId("S2007");
    staffInfo.setStaffCode("S2007");
    staffInfo.setPost("MASTER");
    staffInfo.setStaffName("测试员工9");
    staffInfo.setSexType("M");
    staffInfo.setEmail("test3@aliyun.com");
    staffInfo.setEntryDate(LocalDate.now());
    staffInfo.setStatus(1);
    staffInfo.setOrganId("100007");
    // staffInfoVO.setPhoto(FileUtil.readAsBytes("classpath:/mock/staff_photo.jpg"));
    staffInfo.setCountry("86");
    SqlToyContext context = new SqlToyContext();
    try {
        context.initialize();
        StaffInfoVO staffInfoVO = MapperUtils.map(context, staffInfo, StaffInfoVO.class);
        System.err.println(JSON.toJSONString(staffInfoVO));
        StaffInfo staffInfo1 = MapperUtils.map(context, staffInfoVO, StaffInfo.class);
        System.err.println(JSON.toJSONString(staffInfo1));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : StaffInfoVO(org.sagacity.sqltoy.demo.vo.StaffInfoVO) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) StaffInfo(org.sagacity.sqltoy.demo.domain.StaffInfo) Test(org.junit.jupiter.api.Test)

Example 9 with SqlToyContext

use of org.sagacity.sqltoy.SqlToyContext in project sagacity-sqltoy by chenrenfei.

the class SqltoyAutoConfiguration method sqlToyContext.

// 构建sqltoy上下文,并指定初始化方法和销毁方法
@Bean(name = "sqlToyContext", initMethod = "initialize", destroyMethod = "destroy")
@ConditionalOnMissingBean
SqlToyContext sqlToyContext() throws Exception {
    // 用辅助配置来校验是否配置错误
    if (StringUtil.isBlank(properties.getSqlResourcesDir()) && StringUtil.isNotBlank(sqlResourcesDir)) {
        throw new IllegalArgumentException("请检查sqltoy配置,是spring.sqltoy作为前缀,而不是sqltoy!\n正确范例: spring.sqltoy.sqlResourcesDir=classpath:com/sagframe/modules");
    }
    SqlToyContext sqlToyContext = new SqlToyContext();
    // 当发现有重复sqlId时是否抛出异常,终止程序执行
    sqlToyContext.setBreakWhenSqlRepeat(properties.isBreakWhenSqlRepeat());
    // sql 文件资源路径
    sqlToyContext.setSqlResourcesDir(properties.getSqlResourcesDir());
    if (properties.getSqlResources() != null && properties.getSqlResources().length > 0) {
        List<String> resList = new ArrayList<String>();
        for (String prop : properties.getSqlResources()) {
            resList.add(prop);
        }
        sqlToyContext.setSqlResources(resList);
    }
    // sql文件解析的编码格式,默认utf-8
    if (properties.getEncoding() != null) {
        sqlToyContext.setEncoding(properties.getEncoding());
    }
    // pojo 扫描路径,意义不存在
    if (properties.getPackagesToScan() != null) {
        sqlToyContext.setPackagesToScan(properties.getPackagesToScan());
    }
    // 特定pojo类加载,意义已经不存在
    if (properties.getAnnotatedClasses() != null) {
        sqlToyContext.setAnnotatedClasses(properties.getAnnotatedClasses());
    }
    // 批量操作时(saveAll、updateAll),每批次数量,默认200
    if (properties.getBatchSize() != null) {
        sqlToyContext.setBatchSize(properties.getBatchSize());
    }
    // 默认数据库fetchSize
    if (properties.getFetchSize() > 0) {
        sqlToyContext.setFetchSize(properties.getFetchSize());
    }
    // 分页查询单页最大记录数量(默认50000)
    if (properties.getPageFetchSizeLimit() != null) {
        sqlToyContext.setPageFetchSizeLimit(properties.getPageFetchSizeLimit());
    }
    // sql 检测间隔时长(单位秒)
    if (properties.getScriptCheckIntervalSeconds() != null) {
        sqlToyContext.setScriptCheckIntervalSeconds(properties.getScriptCheckIntervalSeconds());
    }
    // 缓存、sql文件在初始化后延时多少秒开始检测
    if (properties.getDelayCheckSeconds() != null) {
        sqlToyContext.setDelayCheckSeconds(properties.getDelayCheckSeconds());
    }
    // 是否debug模式
    if (properties.getDebug() != null) {
        sqlToyContext.setDebug(properties.getDebug());
    }
    // sql执行超过多长时间则打印提醒(默认30秒)
    if (properties.getPrintSqlTimeoutMillis() != null) {
        sqlToyContext.setPrintSqlTimeoutMillis(properties.getPrintSqlTimeoutMillis());
    }
    // sql函数转换器
    if (properties.getFunctionConverts() != null) {
        sqlToyContext.setFunctionConverts(properties.getFunctionConverts());
    }
    // 缓存翻译配置
    if (properties.getTranslateConfig() != null) {
        sqlToyContext.setTranslateConfig(properties.getTranslateConfig());
    }
    // 数据库保留字
    if (properties.getReservedWords() != null) {
        sqlToyContext.setReservedWords(properties.getReservedWords());
    }
    // 分页页号超出总页时转第一页,否则返回空集合
    sqlToyContext.setPageOverToFirst(properties.isPageOverToFirst());
    // 数据库方言
    sqlToyContext.setDialect(properties.getDialect());
    // sqltoy内置参数默认值修改
    sqlToyContext.setDialectConfig(properties.getDialectConfig());
    // update 2021-01-18 设置缓存类别,默认ehcache
    sqlToyContext.setCacheType(properties.getCacheType());
    sqlToyContext.setSecurePrivateKey(properties.getSecurePrivateKey());
    sqlToyContext.setSecurePublicKey(properties.getSecurePublicKey());
    // 设置公共统一属性的处理器
    String unfiyHandler = properties.getUnifyFieldsHandler();
    if (StringUtil.isNotBlank(unfiyHandler)) {
        try {
            IUnifyFieldsHandler handler = null;
            // 类
            if (unfiyHandler.contains(".")) {
                handler = (IUnifyFieldsHandler) Class.forName(unfiyHandler).getDeclaredConstructor().newInstance();
            } else // spring bean名称
            if (applicationContext.containsBean(unfiyHandler)) {
                handler = (IUnifyFieldsHandler) applicationContext.getBean(unfiyHandler);
                if (handler == null) {
                    throw new ClassNotFoundException("项目中未定义unifyFieldsHandler=" + unfiyHandler + " 对应的bean!");
                }
            }
            if (handler != null) {
                sqlToyContext.setUnifyFieldsHandler(handler);
            }
        } catch (ClassNotFoundException cne) {
            err.println("------------------- 错误提示 ------------------------------------------- ");
            err.println("spring.sqltoy.unifyFieldsHandler=" + unfiyHandler + " 对应类不存在,错误原因:");
            err.println("--1.您可能直接copy了参照项目的配置文件,但没有将具体的类也同步copy过来!");
            err.println("--2.如您并不需要此功能,请将配置文件中注释掉spring.sqltoy.unifyFieldsHandler");
            err.println("------------------------------------------------");
            cne.printStackTrace();
            throw cne;
        }
    }
    // 设置elastic连接
    Elastic es = properties.getElastic();
    if (es != null && es.getEndpoints() != null && !es.getEndpoints().isEmpty()) {
        sqlToyContext.setDefaultElastic(es.getDefaultId());
        List<ElasticEndpoint> endpoints = new ArrayList<ElasticEndpoint>();
        for (ElasticConfig esconfig : es.getEndpoints()) {
            ElasticEndpoint ep = new ElasticEndpoint(esconfig.getUrl(), esconfig.getSqlPath());
            ep.setId(esconfig.getId());
            if (esconfig.getCharset() != null) {
                ep.setCharset(esconfig.getCharset());
            }
            if (esconfig.getRequestTimeout() != null) {
                ep.setRequestTimeout(esconfig.getRequestTimeout());
            }
            if (esconfig.getConnectTimeout() != null) {
                ep.setConnectTimeout(esconfig.getConnectTimeout());
            }
            if (esconfig.getSocketTimeout() != null) {
                ep.setSocketTimeout(esconfig.getSocketTimeout());
            }
            ep.setAuthCaching(esconfig.isAuthCaching());
            ep.setUsername(esconfig.getUsername());
            ep.setPassword(esconfig.getPassword());
            ep.setKeyStore(esconfig.getKeyStore());
            ep.setKeyStorePass(esconfig.getKeyStorePass());
            ep.setKeyStoreSelfSign(esconfig.isKeyStoreSelfSign());
            ep.setKeyStoreType(esconfig.getKeyStoreType());
            endpoints.add(ep);
        }
        // 这里已经完成了当没有设置默认节点时将第一个节点作为默认节点
        sqlToyContext.setElasticEndpoints(endpoints);
    }
    // 设置默认数据库
    if (properties.getDefaultDataSource() != null) {
        sqlToyContext.setDefaultDataSourceName(properties.getDefaultDataSource());
    }
    // 自定义缓存实现管理器
    String translateCacheManager = properties.getTranslateCacheManager();
    if (StringUtil.isNotBlank(translateCacheManager)) {
        // 缓存管理器的bean名称
        if (applicationContext.containsBean(translateCacheManager)) {
            sqlToyContext.setTranslateCacheManager((TranslateCacheManager) applicationContext.getBean(translateCacheManager));
        } else // 包名和类名称
        if (translateCacheManager.contains(".")) {
            sqlToyContext.setTranslateCacheManager((TranslateCacheManager) Class.forName(translateCacheManager).getDeclaredConstructor().newInstance());
        }
    }
    // 自定义typeHandler
    String typeHandler = properties.getTypeHandler();
    if (StringUtil.isNotBlank(typeHandler)) {
        if (applicationContext.containsBean(typeHandler)) {
            sqlToyContext.setTypeHandler((TypeHandler) applicationContext.getBean(typeHandler));
        } else // 包名和类名称
        if (typeHandler.contains(".")) {
            sqlToyContext.setTypeHandler((TypeHandler) Class.forName(typeHandler).getDeclaredConstructor().newInstance());
        }
    }
    // 自定义数据源选择器
    String dataSourceSelector = properties.getDataSourceSelector();
    if (StringUtil.isNotBlank(dataSourceSelector)) {
        if (applicationContext.containsBean(dataSourceSelector)) {
            sqlToyContext.setDataSourceSelector((DataSourceSelector) applicationContext.getBean(dataSourceSelector));
        } else // 包名和类名称
        if (dataSourceSelector.contains(".")) {
            sqlToyContext.setDataSourceSelector((DataSourceSelector) Class.forName(dataSourceSelector).getDeclaredConstructor().newInstance());
        }
    }
    // 自定义数据库连接获取和释放的接口实现
    String connectionFactory = properties.getConnectionFactory();
    if (StringUtil.isNotBlank(connectionFactory)) {
        if (applicationContext.containsBean(connectionFactory)) {
            sqlToyContext.setConnectionFactory((ConnectionFactory) applicationContext.getBean(connectionFactory));
        } else // 包名和类名称
        if (connectionFactory.contains(".")) {
            sqlToyContext.setConnectionFactory((ConnectionFactory) Class.forName(connectionFactory).getDeclaredConstructor().newInstance());
        }
    }
    // 自定义字段安全实现器
    String fieldsSecureProvider = properties.getFieldsSecureProvider();
    if (StringUtil.isNotBlank(fieldsSecureProvider)) {
        if (applicationContext.containsBean(fieldsSecureProvider)) {
            sqlToyContext.setFieldsSecureProvider((FieldsSecureProvider) applicationContext.getBean(fieldsSecureProvider));
        } else // 包名和类名称
        if (fieldsSecureProvider.contains(".")) {
            sqlToyContext.setFieldsSecureProvider((FieldsSecureProvider) Class.forName(fieldsSecureProvider).getDeclaredConstructor().newInstance());
        }
    }
    // 自定义字段脱敏处理器
    String desensitizeProvider = properties.getDesensitizeProvider();
    if (StringUtil.isNotBlank(desensitizeProvider)) {
        if (applicationContext.containsBean(desensitizeProvider)) {
            sqlToyContext.setDesensitizeProvider((DesensitizeProvider) applicationContext.getBean(desensitizeProvider));
        } else // 包名和类名称
        if (desensitizeProvider.contains(".")) {
            sqlToyContext.setDesensitizeProvider((DesensitizeProvider) Class.forName(desensitizeProvider).getDeclaredConstructor().newInstance());
        }
    }
    return sqlToyContext;
}
Also used : DataSourceSelector(org.sagacity.sqltoy.plugins.datasource.DataSourceSelector) TranslateCacheManager(org.sagacity.sqltoy.translate.cache.TranslateCacheManager) ArrayList(java.util.ArrayList) ElasticEndpoint(org.sagacity.sqltoy.config.model.ElasticEndpoint) FieldsSecureProvider(org.sagacity.sqltoy.plugins.secure.FieldsSecureProvider) IUnifyFieldsHandler(org.sagacity.sqltoy.plugins.IUnifyFieldsHandler) ConnectionFactory(org.sagacity.sqltoy.plugins.datasource.ConnectionFactory) SqlToyContext(org.sagacity.sqltoy.SqlToyContext) TypeHandler(org.sagacity.sqltoy.plugins.TypeHandler) DesensitizeProvider(org.sagacity.sqltoy.plugins.secure.DesensitizeProvider) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SqlToyContext (org.sagacity.sqltoy.SqlToyContext)9 ArrayList (java.util.ArrayList)7 Connection (java.sql.Connection)6 List (java.util.List)6 DataSourceCallbackHandler (org.sagacity.sqltoy.callback.DataSourceCallbackHandler)6 ParallelCallbackHandler (org.sagacity.sqltoy.callback.ParallelCallbackHandler)5 BaseException (org.sagacity.sqltoy.exception.BaseException)5 ShardingGroupModel (org.sagacity.sqltoy.model.ShardingGroupModel)5 ShardingModel (org.sagacity.sqltoy.model.ShardingModel)5 Test (org.junit.jupiter.api.Test)2 StaffInfo (org.sagacity.sqltoy.demo.domain.StaffInfo)2 StaffInfoVO (org.sagacity.sqltoy.demo.vo.StaffInfoVO)2 FieldsSecureProvider (org.sagacity.sqltoy.plugins.secure.FieldsSecureProvider)2 Serializable (java.io.Serializable)1 Type (java.lang.reflect.Type)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors (java.util.concurrent.Executors)1 TimeUnit (java.util.concurrent.TimeUnit)1