diff --git a/config/pom.xml b/config/pom.xml index a8f564ffd..40bb65402 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -48,10 +48,6 @@ com.alibaba.nacos nacos-persistence - - org.springframework.boot - spring-boot-starter-jdbc - commons-io commons-io diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java index 77fa6ac9e..8f65dc976 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java @@ -27,7 +27,7 @@ import com.alibaba.nacos.config.server.model.event.DerbyImportEvent; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.persistence.datasource.LocalDataSourceServiceImpl; import com.alibaba.nacos.config.server.service.dump.DumpService; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.sys.utils.ApplicationUtils; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DistributedDatabaseOperateImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DistributedDatabaseOperateImpl.java index cb883a180..462eb2a9d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DistributedDatabaseOperateImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DistributedDatabaseOperateImpl.java @@ -40,6 +40,7 @@ import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.persistence.datasource.LocalDataSourceServiceImpl; import com.alibaba.nacos.config.server.service.dump.DumpConfigHandler; import com.alibaba.nacos.config.server.service.repository.RowMapperManager; +import com.alibaba.nacos.persistence.repository.embedded.operate.BaseDatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.persistence.repository.embedded.sql.ModifyRequest; import com.alibaba.nacos.persistence.repository.embedded.sql.QueryType; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedCommonPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedCommonPersistServiceImpl.java index 1ed2a18d6..2641a3d7d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedCommonPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedCommonPersistServiceImpl.java @@ -25,6 +25,7 @@ import com.alibaba.nacos.config.server.model.event.DerbyImportEvent; import com.alibaba.nacos.persistence.datasource.DataSourceService; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.CommonPersistService; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoAggrPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoAggrPersistServiceImpl.java index 57272662f..92da998ea 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoAggrPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoAggrPersistServiceImpl.java @@ -30,6 +30,7 @@ import com.alibaba.nacos.persistence.datasource.DataSourceService; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.ConfigInfoAggrPersistService; import com.alibaba.nacos.persistence.repository.PaginationHelper; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoBetaPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoBetaPersistServiceImpl.java index 18b17226f..64fe5d076 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoBetaPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoBetaPersistServiceImpl.java @@ -31,6 +31,7 @@ import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.ConfigInfoBetaPersistService; import com.alibaba.nacos.persistence.repository.PaginationHelper; import com.alibaba.nacos.config.server.service.sql.EmbeddedStorageContextUtils; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java index d155fe466..5acdcce98 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoPersistServiceImpl.java @@ -43,6 +43,7 @@ import com.alibaba.nacos.persistence.repository.PaginationHelper; import com.alibaba.nacos.config.server.service.sql.EmbeddedStorageContextUtils; import com.alibaba.nacos.config.server.utils.ParamUtils; import com.alibaba.nacos.core.distributed.id.IdGeneratorManager; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoTagPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoTagPersistServiceImpl.java index 6263e3c70..9b42c129f 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoTagPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedConfigInfoTagPersistServiceImpl.java @@ -30,6 +30,7 @@ import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.ConfigInfoTagPersistService; import com.alibaba.nacos.persistence.repository.PaginationHelper; import com.alibaba.nacos.config.server.service.sql.EmbeddedStorageContextUtils; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java index 3c78fb6c6..62e83e55d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedHistoryConfigInfoPersistServiceImpl.java @@ -29,6 +29,7 @@ import com.alibaba.nacos.persistence.datasource.DataSourceService; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.HistoryConfigInfoPersistService; import com.alibaba.nacos.persistence.repository.PaginationHelper; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedPaginationHelperImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedPaginationHelperImpl.java index 95b4b0958..77c5680ab 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedPaginationHelperImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedPaginationHelperImpl.java @@ -18,6 +18,7 @@ package com.alibaba.nacos.config.server.service.repository.embedded; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.model.MapperResult; import org.springframework.jdbc.core.RowMapper; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java index 5060643e4..648e57ebf 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/EmbeddedStoragePersistServiceImpl.java @@ -49,6 +49,7 @@ import com.alibaba.nacos.config.server.service.repository.PersistService; import com.alibaba.nacos.config.server.service.sql.EmbeddedStorageContextUtils; import com.alibaba.nacos.config.server.utils.ParamUtils; import com.alibaba.nacos.core.distributed.id.IdGeneratorManager; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.plugin.datasource.MapperManager; import com.alibaba.nacos.plugin.datasource.constants.FieldConstant; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/StandaloneDatabaseOperateImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/StandaloneDatabaseOperateImpl.java index bbc68262d..aeeb22c3d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/StandaloneDatabaseOperateImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/StandaloneDatabaseOperateImpl.java @@ -23,6 +23,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.config.server.configuration.ConditionStandaloneEmbedStorage; import com.alibaba.nacos.persistence.datasource.DataSourceService; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; +import com.alibaba.nacos.persistence.repository.embedded.operate.BaseDatabaseOperate; import com.alibaba.nacos.persistence.repository.embedded.sql.ModifyRequest; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.sys.utils.DiskUtils; diff --git a/config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigOpsControllerTest.java b/config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigOpsControllerTest.java index 76f76c21a..f3fab691f 100644 --- a/config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigOpsControllerTest.java +++ b/config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigOpsControllerTest.java @@ -21,7 +21,7 @@ import com.alibaba.nacos.config.server.constant.Constants; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.persistence.datasource.LocalDataSourceServiceImpl; import com.alibaba.nacos.config.server.service.dump.DumpService; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.utils.PropertyUtil; import com.alibaba.nacos.persistence.configuration.DatasourceConfiguration; import com.alibaba.nacos.sys.env.EnvUtil; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/BaseDatabaseOperate.java b/persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java similarity index 81% rename from config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/BaseDatabaseOperate.java rename to persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java index 214e54c50..3e91d120f 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/BaseDatabaseOperate.java +++ b/persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/BaseDatabaseOperate.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2018 Alibaba Group Holding Ltd. + * Copyright 1999-2023 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. @@ -14,13 +14,14 @@ * limitations under the License. */ -package com.alibaba.nacos.config.server.service.repository.embedded; +package com.alibaba.nacos.persistence.repository.embedded.operate; import com.alibaba.nacos.common.utils.ExceptionUtil; import com.alibaba.nacos.common.utils.LoggerUtils; import com.alibaba.nacos.persistence.repository.embedded.sql.ModifyRequest; import com.alibaba.nacos.persistence.utils.DerbyUtils; -import com.alibaba.nacos.config.server.utils.LogUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.IncorrectResultSizeDataAccessException; @@ -36,8 +37,6 @@ import java.util.Map; import java.util.function.BiConsumer; import java.util.stream.IntStream; -import static com.alibaba.nacos.config.server.utils.LogUtil.FATAL_LOG; - /** * The Derby database basic operation. * @@ -46,6 +45,8 @@ import static com.alibaba.nacos.config.server.utils.LogUtil.FATAL_LOG; @SuppressWarnings("PMD.AbstractMethodOrInterfaceMethodMustUseJavadocRule") public interface BaseDatabaseOperate extends DatabaseOperate { + Logger LOGGER = LoggerFactory.getLogger(BaseDatabaseOperate.class); + /** * query one result by sql then convert result to target type. * @@ -61,10 +62,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { } catch (IncorrectResultSizeDataAccessException e) { return null; } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] can't get connection : {}", ExceptionUtil.getAllExceptionMsg(e)); + LOGGER.error("[db-error] can't get connection : {}", ExceptionUtil.getAllExceptionMsg(e)); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException : {}", ExceptionUtil.getAllExceptionMsg(e)); + LOGGER.error("[db-error] DataAccessException : {}", ExceptionUtil.getAllExceptionMsg(e)); throw e; } } @@ -85,10 +86,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { } catch (IncorrectResultSizeDataAccessException e) { return null; } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] {}", e.toString()); + LOGGER.error("[db-error] {}", e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, ExceptionUtil.getAllExceptionMsg(e)); throw e; } @@ -110,10 +111,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { } catch (IncorrectResultSizeDataAccessException e) { return null; } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] {}", e.toString()); + LOGGER.error("[db-error] {}", e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, ExceptionUtil.getAllExceptionMsg(e)); throw e; } @@ -133,10 +134,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { try { return jdbcTemplate.query(sql, args, mapper); } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] {}", e.toString()); + LOGGER.error("[db-error] {}", e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, ExceptionUtil.getAllExceptionMsg(e)); throw e; } @@ -158,10 +159,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { } catch (IncorrectResultSizeDataAccessException e) { return null; } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] {}", e.toString()); + LOGGER.error("[db-error] {}", e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, ExceptionUtil.getAllExceptionMsg(e)); throw e; } @@ -179,10 +180,10 @@ public interface BaseDatabaseOperate extends DatabaseOperate { try { return jdbcTemplate.queryForList(sql, args); } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] {}", e.toString()); + LOGGER.error("[db-error] {}", e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", sql, args, ExceptionUtil.getAllExceptionMsg(e)); throw e; } @@ -221,11 +222,11 @@ public interface BaseDatabaseOperate extends DatabaseOperate { errSql[0] = pair.getSql(); args[0] = pair.getArgs(); boolean rollBackOnUpdateFail = pair.isRollBackOnUpdateFail(); - LoggerUtils.printIfDebugEnabled(LogUtil.DEFAULT_LOG, "current sql : {}", errSql[0]); - LoggerUtils.printIfDebugEnabled(LogUtil.DEFAULT_LOG, "current args : {}", args[0]); + LoggerUtils.printIfDebugEnabled(LOGGER, "current sql : {}", errSql[0]); + LoggerUtils.printIfDebugEnabled(LOGGER, "current args : {}", args[0]); int row = jdbcTemplate.update(pair.getSql(), pair.getArgs()); if (rollBackOnUpdateFail && row < 1) { - LoggerUtils.printIfDebugEnabled(LogUtil.DEFAULT_LOG, "SQL update affected {} rows ", row); + LoggerUtils.printIfDebugEnabled(LOGGER, "SQL update affected {} rows ", row); throw new IllegalTransactionStateException("Illegal transaction"); } }); @@ -234,22 +235,22 @@ public interface BaseDatabaseOperate extends DatabaseOperate { } return Boolean.TRUE; } catch (BadSqlGrammarException | DataIntegrityViolationException e) { - FATAL_LOG.error("[db-error] sql : {}, args : {}, error : {}", errSql[0], args[0], e.toString()); + LOGGER.error("[db-error] sql : {}, args : {}, error : {}", errSql[0], args[0], e.toString()); if (consumer != null) { consumer.accept(Boolean.FALSE, e); } return Boolean.FALSE; } catch (CannotGetJdbcConnectionException e) { - FATAL_LOG.error("[db-error] sql : {}, args : {}, error : {}", errSql[0], args[0], e.toString()); + LOGGER.error("[db-error] sql : {}, args : {}, error : {}", errSql[0], args[0], e.toString()); throw e; } catch (DataAccessException e) { - FATAL_LOG.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", errSql[0], - args[0], ExceptionUtil.getAllExceptionMsg(e)); + LOGGER.error("[db-error] DataAccessException sql : {}, args : {}, error : {}", errSql[0], args[0], + ExceptionUtil.getAllExceptionMsg(e)); throw e; } }); } catch (IllegalTransactionStateException e) { - LoggerUtils.printIfDebugEnabled(LogUtil.DEFAULT_LOG, "Roll back transaction for {} ", e.getMessage()); + LoggerUtils.printIfDebugEnabled(LOGGER, "Roll back transaction for {} ", e.getMessage()); if (consumer != null) { consumer.accept(Boolean.FALSE, e); } diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DatabaseOperate.java b/persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/DatabaseOperate.java similarity index 97% rename from config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DatabaseOperate.java rename to persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/DatabaseOperate.java index f330866af..568d73f9e 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/repository/embedded/DatabaseOperate.java +++ b/persistence/src/main/java/com/alibaba/nacos/persistence/repository/embedded/operate/DatabaseOperate.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2018 Alibaba Group Holding Ltd. + * Copyright 1999-2023 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.config.server.service.repository.embedded; +package com.alibaba.nacos.persistence.repository.embedded.operate; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; diff --git a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java index 38a49deaa..d0dadd01c 100644 --- a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java +++ b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImpl.java @@ -20,7 +20,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.config.server.configuration.ConditionOnEmbeddedStorage; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import org.springframework.beans.factory.annotation.Autowired; diff --git a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImpl.java b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImpl.java index 9b3125bc1..aea07576f 100644 --- a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImpl.java +++ b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImpl.java @@ -24,7 +24,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.config.server.configuration.ConditionOnEmbeddedStorage; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; diff --git a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImpl.java b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImpl.java index 01524422c..7f11ab686 100644 --- a/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImpl.java +++ b/plugin-default-impl/src/main/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImpl.java @@ -20,7 +20,7 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.config.server.configuration.ConditionOnEmbeddedStorage; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; diff --git a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImplTest.java b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImplTest.java index 4c3965da3..1708a5c8d 100644 --- a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImplTest.java +++ b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedPermissionPersistServiceImplTest.java @@ -18,7 +18,7 @@ package com.alibaba.nacos.plugin.auth.impl.persistence; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.persistence.repository.embedded.sql.ModifyRequest; diff --git a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImplTest.java b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImplTest.java index b92632dc3..e1fe304bb 100644 --- a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImplTest.java +++ b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedRolePersistServiceImplTest.java @@ -18,7 +18,7 @@ package com.alibaba.nacos.plugin.auth.impl.persistence; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import com.alibaba.nacos.persistence.repository.embedded.EmbeddedStorageContextHolder; import com.alibaba.nacos.persistence.repository.embedded.sql.ModifyRequest; diff --git a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImplTest.java b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImplTest.java index ef49d6e2d..2f6d268fa 100644 --- a/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImplTest.java +++ b/plugin-default-impl/src/test/java/com/alibaba/nacos/plugin/auth/impl/persistence/EmbeddedUserPersistServiceImplTest.java @@ -18,7 +18,7 @@ package com.alibaba.nacos.plugin.auth.impl.persistence; import com.alibaba.nacos.persistence.model.Page; import com.alibaba.nacos.persistence.repository.PaginationHelper; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.config.server.service.repository.embedded.EmbeddedStoragePersistServiceImpl; import org.junit.Assert; import org.junit.Before; diff --git a/test/config-test/src/test/java/com/alibaba/nacos/test/config/ConfigDerbyImport_CITCase.java b/test/config-test/src/test/java/com/alibaba/nacos/test/config/ConfigDerbyImport_CITCase.java index f8ffdf23a..9930f2451 100644 --- a/test/config-test/src/test/java/com/alibaba/nacos/test/config/ConfigDerbyImport_CITCase.java +++ b/test/config-test/src/test/java/com/alibaba/nacos/test/config/ConfigDerbyImport_CITCase.java @@ -23,7 +23,7 @@ import com.alibaba.nacos.common.utils.ByteUtils; import com.alibaba.nacos.config.server.model.ConfigInfo; import com.alibaba.nacos.persistence.datasource.DynamicDataSource; import com.alibaba.nacos.config.server.service.repository.PersistService; -import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; +import com.alibaba.nacos.persistence.repository.embedded.operate.DatabaseOperate; import com.alibaba.nacos.sys.utils.DiskUtils; import com.alibaba.nacos.test.base.ConfigCleanUtils; import org.junit.Assert;