From 457379b279dd7223a41bc4a4e5d13ac00f77356a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E7=A7=91=E9=93=AD?= <10207479@qq.com> Date: Mon, 20 Nov 2023 15:27:07 +0800 Subject: [PATCH] remove dataSource plugin Dialect --- .../datasource/constants/PageConstant.java | 35 ----------- .../datasource/dialects/DerbyDialect.java | 45 -------------- .../datasource/dialects/DialectFactory.java | 50 --------------- .../datasource/dialects/DialectModel.java | 45 -------------- .../plugin/datasource/dialects/IDialect.java | 45 -------------- .../datasource/dialects/MySqlDialect.java | 43 ------------- .../plugin/datasource/enums/DbTypeEnum.java | 62 ------------------- .../DbDialectNotSupportException.java | 39 ------------ .../derby/ConfigInfoAggrMapperByDerby.java | 13 ---- .../derby/ConfigInfoBetaMapperByDerby.java | 13 ---- .../impl/derby/ConfigInfoMapperByDerby.java | 14 ----- .../derby/ConfigInfoTagMapperByDerby.java | 13 ---- .../ConfigInfoTagsRelationMapperByDerby.java | 13 ---- .../derby/GroupCapacityMapperByDerby.java | 13 ---- .../derby/HistoryConfigInfoMapperByDerby.java | 13 ---- .../derby/TenantCapacityMapperByDerby.java | 13 ---- .../impl/derby/TenantInfoMapperByDerby.java | 13 ---- .../mysql/ConfigInfoAggrMapperByMySql.java | 13 ---- .../mysql/ConfigInfoBetaMapperByMySql.java | 13 ---- .../impl/mysql/ConfigInfoMapperByMySql.java | 13 ---- .../mysql/ConfigInfoTagMapperByMySql.java | 13 ---- .../ConfigTagsRelationMapperByMySql.java | 13 ---- .../mysql/GroupCapacityMapperByMysql.java | 13 ---- .../mysql/HistoryConfigInfoMapperByMySql.java | 13 ---- .../mysql/TenantCapacityMapperByMySql.java | 12 ---- .../impl/mysql/TenantInfoMapperByMySql.java | 13 ---- .../plugin/datasource/mapper/Mapper.java | 15 ----- .../plugin/datasource/MapperManagerTest.java | 13 ---- .../ConfigInfoAggrMapperByDerbyTest.java | 14 ----- .../ConfigInfoBetaMapperByDerbyTest.java | 14 ----- .../derby/ConfigInfoMapperByDerbyTest.java | 14 ----- .../derby/ConfigInfoTagMapperByDerbyTest.java | 14 ----- ...nfigInfoTagsRelationMapperByDerbyTest.java | 14 ----- .../derby/GroupCapacityMapperByDerbyTest.java | 14 ----- .../HistoryConfigInfoMapperByDerbyTest.java | 14 ----- .../TenantCapacityMapperByDerbyTest.java | 14 ----- .../derby/TenantInfoMapperByDerbyTest.java | 14 ----- .../ConfigInfoAggrMapperByMySqlTest.java | 14 ----- .../ConfigInfoBetaMapperByMySqlTest.java | 14 ----- .../mysql/ConfigInfoMapperByMySqlTest.java | 14 ----- .../mysql/ConfigInfoTagMapperByMySqlTest.java | 14 ----- .../ConfigTagsRelationMapperByMySqlTest.java | 14 ----- .../mysql/GroupCapacityMapperByMysqlTest.java | 14 ----- .../HistoryConfigInfoMapperByMySqlTest.java | 14 ----- .../TenantCapacityMapperByMySqlTest.java | 14 ----- .../mysql/TenantInfoMapperByMySqlTest.java | 14 ----- .../datasource/proxy/MapperProxyTest.java | 13 ---- 47 files changed, 891 deletions(-) delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/constants/PageConstant.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DerbyDialect.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectFactory.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectModel.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/IDialect.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/MySqlDialect.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/enums/DbTypeEnum.java delete mode 100644 plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/exception/DbDialectNotSupportException.java diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/constants/PageConstant.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/constants/PageConstant.java deleted file mode 100644 index 0edba1f6fe8..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/constants/PageConstant.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 1999-2022 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.constants; - -/** - * The Page constant. - * - * @author huangKeMing - **/ -public class PageConstant { - - public static final String OFFSET = "OFFSET"; - - public static final String ROWS = "ROWS"; - - public static final String FETCH_NEXT = "FETCH NEXT"; - - public static final String ONLY = "ONLY"; - - public static final String LIMIT = "LIMIT"; -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DerbyDialect.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DerbyDialect.java deleted file mode 100644 index 1b532665a00..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DerbyDialect.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.dialects; - -import com.alibaba.nacos.plugin.datasource.constants.PageConstant; - -import java.util.Arrays; - -/** - * Derby Database pagination statement assembly implementation. - * - * @author huangKeMing - */ -public class DerbyDialect implements IDialect { - - @Override - public DialectModel buildPaginationSql(String sqlFetchRows, Object[] args, int pageNo, int pageSize) { - if (!sqlFetchRows.contains(PageConstant.OFFSET)) { - StringBuilder sqlFetch = new StringBuilder(sqlFetchRows).append(" ").append(PageConstant.OFFSET).append(" ") - .append(FIRST_MARK).append(" ").append(PageConstant.ROWS).append(" ") - .append(PageConstant.FETCH_NEXT).append(" ").append(SECOND_MARK).append(" ") - .append(PageConstant.ROWS).append(" ").append(PageConstant.ONLY); - Object[] newArgs = Arrays.copyOf(args, args.length + 2); - newArgs[args.length] = (pageNo - 1) * pageSize; - newArgs[args.length + 1] = pageSize; - return new DialectModel(sqlFetch.toString(), newArgs); - } else { - return new DialectModel(sqlFetchRows, args); - } - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectFactory.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectFactory.java deleted file mode 100644 index 5896d2c0157..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.dialects; - -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; -import com.alibaba.nacos.plugin.datasource.exception.DbDialectNotSupportException; - -import java.util.EnumMap; -import java.util.Map; - -/** - * Paginated dialect factory. - * - * @author huangKeMing - */ -public class DialectFactory { - - private static final Map DIALECT_ENUM_MAP = new EnumMap<>(DbTypeEnum.class); - - public static IDialect getDialect(final DbTypeEnum dbType) { - IDialect dialect = DIALECT_ENUM_MAP.get(dbType); - if (null == dialect) { - if (dbType == DbTypeEnum.OTHER) { - throw new DbDialectNotSupportException(" DbDialect database not supported. " + dbType.getDb()); - } else if (dbType == DbTypeEnum.MYSQL) { - // mysql same type - dialect = new MySqlDialect(); - } else if (dbType == DbTypeEnum.DERBY) { - // derby same type - dialect = new DerbyDialect(); - } - DIALECT_ENUM_MAP.put(dbType, dialect); - } - return dialect; - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectModel.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectModel.java deleted file mode 100644 index c5749ac9a70..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/DialectModel.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2011-2023, baomidou (jobob@qq.com). - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.dialects; - -/** - * The model required for the pagination parameter to be dynamic. - * - * @author huangKeMing - */ -public class DialectModel { - - private String sqlFetchRows; - - private Object[] args; - - public DialectModel() { - } - - public DialectModel(String sqlFetchRows, Object[] args) { - this.sqlFetchRows = sqlFetchRows; - this.args = args; - } - - public String getSqlFetchRows() { - return sqlFetchRows; - } - - public Object[] getArgs() { - return args; - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/IDialect.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/IDialect.java deleted file mode 100644 index f5e5797834f..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/IDialect.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.dialects; - -/** - * Database pagination statement assembly interface. - * - * @author huangKeMing - */ -public interface IDialect { - - /** - * These are of no particular significance, just to make classes easier to use and to distinguish between parameters - * for paginated SQL. - */ - String FIRST_MARK = "?"; - String SECOND_MARK = "?"; - - String COMMA = ","; - - /** - * Assemble the pagination statement. - * - * @param sqlFetchRows Original statement. - * @param args parameters. - * @param pageNo Start pagination. - * @param pageSize The size of the pagination. - * @return - */ - DialectModel buildPaginationSql(String sqlFetchRows, Object[] args, int pageNo, int pageSize); -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/MySqlDialect.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/MySqlDialect.java deleted file mode 100644 index 0173607c928..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/dialects/MySqlDialect.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.dialects; - -import com.alibaba.nacos.plugin.datasource.constants.PageConstant; - -import java.util.Arrays; - -/** - * Mysql Database pagination statement assembly implementation. - * - * @author huangKeMing - */ -public class MySqlDialect implements IDialect { - - @Override - public DialectModel buildPaginationSql(String sqlFetchRows, Object[] args, int pageNo, int pageSize) { - if (!sqlFetchRows.contains(PageConstant.LIMIT)) { - StringBuilder sqlFetch = new StringBuilder(sqlFetchRows) - .append(" ").append(PageConstant.LIMIT).append(" ").append(FIRST_MARK).append(COMMA).append(SECOND_MARK); - Object[] newArgs = Arrays.copyOf(args, args.length + 2); - newArgs[args.length] = (pageNo - 1) * pageSize; - newArgs[args.length + 1] = pageSize; - return new DialectModel(sqlFetch.toString(), newArgs); - } else { - return new DialectModel(sqlFetchRows, args); - } - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/enums/DbTypeEnum.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/enums/DbTypeEnum.java deleted file mode 100644 index a7cebc5f531..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/enums/DbTypeEnum.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.enums; - -/** - * Supported database types, primarily for pagination dialects. - * - * @author huangKeMing - */ -public enum DbTypeEnum { - - /** - * MYSQL. - */ - MYSQL("mysql"), - - /** - * DERBY. - */ - DERBY("derby"), - - /** - * UNKNOWN DB. - */ - OTHER("other"); - - /** - * The name of the database. - */ - private final String db; - - public static DbTypeEnum getDbType(String dbType) { - for (DbTypeEnum type : DbTypeEnum.values()) { - if (type.db.equalsIgnoreCase(dbType)) { - return type; - } - } - return OTHER; - } - - DbTypeEnum(String db) { - this.db = db; - } - - public String getDb() { - return db; - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/exception/DbDialectNotSupportException.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/exception/DbDialectNotSupportException.java deleted file mode 100644 index 7fce6fd1ec7..00000000000 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/exception/DbDialectNotSupportException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * 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. - */ - -package com.alibaba.nacos.plugin.datasource.exception; - -/** - * DbDialectException. - * - * @author huangKeMing - */ -public class DbDialectNotSupportException extends RuntimeException { - - private static final long serialVersionUID = 1L; - - public DbDialectNotSupportException(String message) { - super(message); - } - - public DbDialectNotSupportException(Throwable throwable) { - super(throwable); - } - - public DbDialectNotSupportException(String message, Throwable throwable) { - super(message, throwable); - } -} diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerby.java index 17999392ad4..01ba4a8177f 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerby.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoAggrMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -56,14 +53,4 @@ public MapperResult findConfigInfoAggrByPageFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerby.java index e897bcb6996..da3556e0096 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerby.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.derby; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoBetaMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -56,14 +53,4 @@ public MapperResult findAllConfigInfoBetaForDumpAllFetchRows(MapperContext conte public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java index 7ca29ad5cd3..1242c8f75b3 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerby.java @@ -21,9 +21,6 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -279,16 +276,6 @@ public MapperResult findAllConfigInfoFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } @Override public MapperResult findChangeConfig(MapperContext context) { @@ -299,5 +286,4 @@ public MapperResult findChangeConfig(MapperContext context) { context.getWhereParameter(FieldConstant.LAST_MAX_ID), context.getWhereParameter(FieldConstant.PAGE_SIZE))); } - } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerby.java index f2c6f781fad..3134871e47e 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerby.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.derby; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoTagMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -48,14 +45,4 @@ public MapperResult findAllConfigInfoTagForDumpAllFetchRows(MapperContext contex public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerby.java index 89b24ff193e..d8de7c03762 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerby.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigTagsRelationMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -139,14 +136,4 @@ public MapperResult findConfigInfoLike4PageFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java index abf26450f60..39a74583c4b 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerby.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.GroupCapacityMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -45,14 +42,4 @@ public MapperResult selectGroupInfoBySize(MapperContext context) { return new MapperResult(sql, CollectionUtils.list(context.getWhereParameter(FieldConstant.ID), context.getPageSize())); } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerby.java index 1d99d8da770..d17f12ddd7e 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerby.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.HistoryConfigInfoMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -67,14 +64,4 @@ public MapperResult findDeletedConfig(MapperContext context) { context.getWhereParameter(FieldConstant.LAST_MAX_ID), context.getWhereParameter(FieldConstant.PAGE_SIZE))); } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java index 15342190f20..d185ccade6a 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerby.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantCapacityMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -47,14 +44,4 @@ public MapperResult getCapacityList4CorrectUsage(MapperContext context) { context.getWhereParameter(FieldConstant.LIMIT_SIZE))); } - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } - } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerby.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerby.java index 8fe5617ee80..6fd12d13b7f 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerby.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerby.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.derby; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantInfoMapper; @@ -35,14 +32,4 @@ public class TenantInfoMapperByDerby extends AbstractMapper implements TenantInf public String getDataSource() { return DataSourceConstant.DERBY; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.DERBY; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySql.java index ea86880ac20..f9bad4153f7 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySql.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoAggrMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -55,14 +52,4 @@ public MapperResult findConfigInfoAggrByPageFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySql.java index 101c774ff7f..6fe9b12070d 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySql.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.mysql; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoBetaMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -54,14 +51,4 @@ public MapperResult findAllConfigInfoBetaForDumpAllFetchRows(MapperContext conte public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java index 7ef52cf6f2a..476a315ecb1 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySql.java @@ -21,9 +21,6 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -277,14 +274,4 @@ public String getDataSource() { return DataSourceConstant.MYSQL; } - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } - } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySql.java index c9b658f0b2e..25dbb0720c2 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySql.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.mysql; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoTagMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -47,14 +44,4 @@ public MapperResult findAllConfigInfoTagForDumpAllFetchRows(MapperContext contex public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySql.java index 4b1d97f579a..728aee2f442 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySql.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigTagsRelationMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -136,14 +133,4 @@ public MapperResult findConfigInfoLike4PageFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysql.java index 9f690e0f19e..3c4fc9460b1 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysql.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.GroupCapacityMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -44,15 +41,5 @@ public MapperResult selectGroupInfoBySize(MapperContext context) { String sql = "SELECT id, group_id FROM group_capacity WHERE id > ? LIMIT ?"; return new MapperResult(sql, CollectionUtils.list(context.getWhereParameter(FieldConstant.ID), context.getPageSize())); } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySql.java index d3839f50b9f..ecbbe700f9c 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySql.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.HistoryConfigInfoMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -56,14 +53,4 @@ public MapperResult pageFindConfigHistoryFetchRows(MapperContext context) { public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySql.java index 03a4d1d17c8..7b8dc09417e 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySql.java @@ -19,9 +19,6 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantCapacityMapper; import com.alibaba.nacos.plugin.datasource.model.MapperContext; @@ -47,13 +44,4 @@ public MapperResult getCapacityList4CorrectUsage(MapperContext context) { context.getWhereParameter(FieldConstant.LIMIT_SIZE))); } - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySql.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySql.java index c12b18f69bc..1de0be12d2a 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySql.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySql.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource.impl.mysql; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.DialectFactory; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantInfoMapper; @@ -35,14 +32,4 @@ public class TenantInfoMapperByMySql extends AbstractMapper implements TenantInf public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return DialectFactory.getDialect(getDbTypeEnum()); - } } diff --git a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/Mapper.java b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/Mapper.java index 584ea7b2a55..20259194b1b 100644 --- a/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/Mapper.java +++ b/plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/mapper/Mapper.java @@ -16,9 +16,6 @@ package com.alibaba.nacos.plugin.datasource.mapper; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; - import java.util.List; /** @@ -86,16 +83,4 @@ public interface Mapper { * @return an array of column names indicating the columns */ String[] getPrimaryKeyGeneratedKeys(); - - /** - * Get the datasource name. - * @return The name of datasource. - */ - DbTypeEnum getDbTypeEnum(); - - /** - * Get dialect. - * @return The dialect. - */ - IDialect getIDialect(); } \ No newline at end of file diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/MapperManagerTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/MapperManagerTest.java index eaa3e8a012a..8bca4765686 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/MapperManagerTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/MapperManagerTest.java @@ -17,9 +17,6 @@ package com.alibaba.nacos.plugin.datasource; import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.dialects.MySqlDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.Mapper; import org.junit.Assert; @@ -59,16 +56,6 @@ public String getTableName() { public String getDataSource() { return DataSourceConstant.MYSQL; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return new MySqlDialect(); - } }); MapperManager instance = MapperManager.instance(false); Mapper mapper = instance.findMapper(DataSourceConstant.MYSQL, "test"); diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerbyTest.java index 5c0c7981bc6..6e66fed33fc 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoAggrMapperByDerbyTest.java @@ -20,8 +20,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -151,16 +149,4 @@ public void testGetDataSource() { String dataSource = configInfoAggrMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoAggrMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoAggrMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerbyTest.java index 9de4e3a63b8..2ed3be3c601 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoBetaMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -139,16 +137,4 @@ public void testGetDataSource() { String dataSource = configInfoBetaMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoBetaMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoBetaMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerbyTest.java index 4e69e827165..f20e9cab8d6 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -312,18 +310,6 @@ public void testGetDataSource() { Assert.assertEquals(sql, DataSourceConstant.DERBY); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testUpdateConfigInfoAtomicCas() { String newContent = "new Content"; diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerbyTest.java index 9a7d81bc6aa..0c552144a5a 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -138,16 +136,4 @@ public void testGetDataSource() { String dataSource = configInfoTagMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoTagMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoTagMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerbyTest.java index 9441b6980f8..6dbe42121eb 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/ConfigInfoTagsRelationMapperByDerbyTest.java @@ -20,8 +20,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -110,16 +108,4 @@ public void testGetDataSource() { String dataSource = configInfoTagsRelationMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoTagsRelationMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoTagsRelationMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerbyTest.java index 2445badfe75..6e749b01948 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/GroupCapacityMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -69,18 +67,6 @@ public void testGetDataSource() { Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = groupCapacityMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = groupCapacityMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testInsertIntoSelect() { Object group = "group"; diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerbyTest.java index c26db484dc4..664655f9076 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/HistoryConfigInfoMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -124,16 +122,4 @@ public void testGetDataSource() { String dataSource = historyConfigInfoMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = historyConfigInfoMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = historyConfigInfoMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerbyTest.java index c26371d396f..be04ed044ed 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantCapacityMapperByDerbyTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -66,18 +64,6 @@ public void testGetDataSource() { Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = tenantCapacityMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = tenantCapacityMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testIncrementUsageWithDefaultQuotaLimit() { MapperResult mapperResult = tenantCapacityMapperByDerby.incrementUsageWithDefaultQuotaLimit(context); diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerbyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerbyTest.java index eaf16d90b5b..58723195380 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerbyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/derby/TenantInfoMapperByDerbyTest.java @@ -18,8 +18,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -44,16 +42,4 @@ public void testGetDataSource() { String dataSource = tenantInfoMapperByDerby.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.DERBY); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = tenantInfoMapperByDerby.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.DERBY); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = tenantInfoMapperByDerby.getIDialect(); - Assert.assertNotNull(iDialect); - } } \ No newline at end of file diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySqlTest.java index f34af8da124..ce27ff774ee 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoAggrMapperByMySqlTest.java @@ -20,8 +20,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -158,16 +156,4 @@ public void testGetDataSource() { String dataSource = configInfoAggrMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoAggrMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoAggrMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySqlTest.java index 2887f6b7a51..a06c21437c6 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoBetaMapperByMySqlTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -140,16 +138,4 @@ public void testGetDataSource() { String dataSource = configInfoBetaMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoBetaMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoBetaMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java index 25d05f23471..d97a3507dff 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoMapperByMySqlTest.java @@ -20,8 +20,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -311,18 +309,6 @@ public void testGetDataSource() { Assert.assertEquals(sql, DataSourceConstant.MYSQL); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testUpdateConfigInfoAtomicCas() { String newContent = "new Content"; diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySqlTest.java index 3e676a34783..7632785b5d4 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigInfoTagMapperByMySqlTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import com.google.common.collect.Lists; @@ -138,16 +136,4 @@ public void testGetDataSource() { String dataSource = configInfoTagMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configInfoTagMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configInfoTagMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySqlTest.java index 6222b013b18..995eb14f242 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/ConfigTagsRelationMapperByMySqlTest.java @@ -20,8 +20,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -110,16 +108,4 @@ public void testGetDataSource() { String dataSource = configTagsRelationMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = configTagsRelationMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = configTagsRelationMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysqlTest.java index fa5eec98685..8f84bde5325 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/GroupCapacityMapperByMysqlTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -69,18 +67,6 @@ public void testGetDataSource() { Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = groupCapacityMapperByMysql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = groupCapacityMapperByMysql.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testInsertIntoSelect() { Object group = "group"; diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySqlTest.java index 839e63168bd..23db27c6ff8 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/HistoryConfigInfoMapperByMySqlTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -121,16 +119,4 @@ public void testGetDataSource() { String dataSource = historyConfigInfoMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = historyConfigInfoMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = historyConfigInfoMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySqlTest.java index 9e75120f38d..7f41e483e29 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantCapacityMapperByMySqlTest.java @@ -19,8 +19,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.model.MapperContext; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.junit.Assert; @@ -66,18 +64,6 @@ public void testGetDataSource() { Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = tenantCapacityMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = tenantCapacityMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } - @Test public void testIncrementUsageWithDefaultQuotaLimit() { MapperResult mapperResult = tenantCapacityMapperByMySql.incrementUsageWithDefaultQuotaLimit(context); diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySqlTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySqlTest.java index 99f1c7dccf3..56654593174 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySqlTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/impl/mysql/TenantInfoMapperByMySqlTest.java @@ -18,8 +18,6 @@ import com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -44,16 +42,4 @@ public void testGetDataSource() { String dataSource = tenantInfoMapperByMySql.getDataSource(); Assert.assertEquals(dataSource, DataSourceConstant.MYSQL); } - - @Test - public void testGetDbTypeEnum() { - DbTypeEnum dbTypeEnum = tenantInfoMapperByMySql.getDbTypeEnum(); - Assert.assertEquals(dbTypeEnum, DbTypeEnum.MYSQL); - } - - @Test - public void testGetIDialect() { - IDialect iDialect = tenantInfoMapperByMySql.getIDialect(); - Assert.assertNotNull(iDialect); - } } \ No newline at end of file diff --git a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/proxy/MapperProxyTest.java b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/proxy/MapperProxyTest.java index 92e12970fd1..c848ebc530f 100644 --- a/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/proxy/MapperProxyTest.java +++ b/plugin/datasource/src/test/java/com/alibaba/nacos/plugin/datasource/proxy/MapperProxyTest.java @@ -16,9 +16,6 @@ package com.alibaba.nacos.plugin.datasource.proxy; -import com.alibaba.nacos.plugin.datasource.dialects.IDialect; -import com.alibaba.nacos.plugin.datasource.dialects.MySqlDialect; -import com.alibaba.nacos.plugin.datasource.enums.DbTypeEnum; import com.alibaba.nacos.plugin.datasource.mapper.Mapper; import org.junit.Assert; import org.junit.Before; @@ -78,16 +75,6 @@ public String getDataSource() { public String[] getPrimaryKeyGeneratedKeys() { return new String[0]; } - - @Override - public DbTypeEnum getDbTypeEnum() { - return DbTypeEnum.MYSQL; - } - - @Override - public IDialect getIDialect() { - return new MySqlDialect(); - } }; Mapper proxy = mapperProxy.createProxy(mapper); try {