From 89669bbdf0537dad97bc0dc9d80e99c8e01f6917 Mon Sep 17 00:00:00 2001 From: xuefengping02 Date: Mon, 10 Jul 2023 14:15:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- caf-database-object-common/pom.xml | 14 +- .../common/DatabaseObjectCheckUtil.java | 14 +- .../common/DatabaseObjectCommonUtil.java | 103 ++++++-- .../cache/DatabaseObjectCacheManager.java | 27 ++- .../common/database/AbstractDatabaseImpl.java | 10 +- .../common/database/DB2Database.java | 10 +- .../common/database/DMDatabase.java | 10 +- .../common/database/DbConfigData.java | 10 +- .../common/database/GspDatabase.java | 10 +- .../common/database/GspDbFactory.java | 13 +- .../common/database/HighGoDatabase.java | 10 +- .../common/database/KingbaseDatabase.java | 10 +- .../common/database/MySQLDatabase.java | 10 +- .../common/database/OpenGaussDatabase.java | 27 +++ .../common/database/OracleDatabase.java | 10 +- .../common/database/OscarDatabase.java | 10 +- .../common/database/PostgreSQLDatabase.java | 10 +- .../common/database/SQLServerDatabase.java | 10 +- .../common/exception/DboException.java | 38 +++ .../common/exception/DboExceptionCode.java | 17 ++ .../common/helper/ObjectMaxLengthHelper.java | 10 +- .../common/helper/SQLReflectHelper.java | 10 +- .../common/helper/TableNameHelper.java | 10 +- .../pom.xml | 35 +++ .../gaussgenerator/OpenGaussSqlGenerator.java | 40 ++++ caf-database-object-deploy-manager/pom.xml | 12 +- .../caf/databaseobject/DataTypeConverter.java | 10 +- .../edp/caf/databaseobject/DataTypeUtil.java | 10 +- .../databaseobject/DatabaseFuncConverter.java | 10 +- .../databaseobject/DboDeployFileService.java | 10 +- .../caf/databaseobject/DboDeployManager.java | 97 ++++++-- .../DboPhysicalNamingStrategy.java | 22 +- .../edp/caf/databaseobject/LetterCase.java | 10 +- .../DboClassConstrutorWhitNoArgGenerator.java | 10 +- .../generate/DboClassGenerateContext.java | 10 +- .../generate/DboClassGenerator.java | 10 +- .../generate/DboClassMethodGenerator.java | 10 +- .../generate/DboCompileUnitGenerator.java | 10 +- .../DboCompileUnitGeneratorContext.java | 10 +- .../generate/DboFieldGenerator.java | 48 +++- .../generate/DboMethodGenerator.java | 10 +- .../generate/DboModuleGenerator.java | 13 +- .../generate/DboModuleGeneratorContext.java | 10 +- .../generate/PrimaryKeyClassGenerator.java | 10 +- .../PrimaryKeyClassGeneratorContext.java | 10 +- .../PrimaryKeyClassMethodGenerator.java | 10 +- ...ryKeyClassMethodWithoutParamGenerator.java | 10 +- .../generate/PrimaryKeyFieldGenerator.java | 14 +- .../helper/DboDeployConfigHelper.java | 10 +- .../sqlprovider/SqlProvider.java | 12 +- caf-database-object-deploy-spi/pom.xml | 12 +- .../IDatabaseObjectSQLReflect.java | 10 +- caf-database-object-deploy/pom.xml | 14 +- .../iec/edp/caf/databaseobject/DboDeploy.java | 102 ++++---- .../caf/databaseobject/DboDeployRequest.java | 16 -- caf-database-object-generator/pom.xml | 12 +- .../iec/edp/caf/generator/BaseGenerator.java | 10 +- .../caf/generator/BaseGeneratorContext.java | 10 +- .../annotation/AnnotationGenerator.java | 10 +- .../AnnotationGeneratorContext.java | 10 +- .../AnnotationMemberGenContext.java | 10 +- .../annotation/AnnotationMemberGenerator.java | 10 +- .../generator/baseInfo/AnnotationInfo.java | 10 +- .../baseInfo/AnnotationMemberInfo.java | 10 +- .../generator/baseInfo/AnnotationType.java | 10 +- .../baseInfo/AnnotationTypeGenerateInfo.java | 10 +- .../generator/baseInfo/BaseGenerateInfo.java | 10 +- .../generator/baseInfo/ClassGenerateInfo.java | 10 +- .../baseInfo/ClassMethodGenerateInfo.java | 10 +- .../baseInfo/ClassPropertyGenerateInfo.java | 10 +- .../baseInfo/CompilationUnitInfo.java | 10 +- .../generator/baseInfo/EnumConstantInfo.java | 10 +- .../generator/baseInfo/EnumGenerateInfo.java | 10 +- .../generator/baseInfo/FieldGenerateInfo.java | 10 +- .../baseInfo/InterfaceGenerateInfo.java | 10 +- .../baseInfo/InterfaceMethodGenerateInfo.java | 10 +- .../InterfacePropertyGenerateInfo.java | 10 +- .../baseInfo/MethodGenerateInfo.java | 10 +- .../baseInfo/ModuleGenerateInfo.java | 10 +- .../caf/generator/baseInfo/ParameterInfo.java | 10 +- .../baseInfo/PropertyGenerateInfo.java | 10 +- .../generator/baseInfo/TypeGeneratorInfo.java | 10 +- .../edp/caf/generator/baseInfo/TypeInfo.java | 10 +- .../compileunit/CompileUnitGenerator.java | 10 +- .../CompileUnitGeneratorContext.java | 10 +- .../composite/CompositeGenerator.java | 10 +- .../composite/CompositeGeneratorContext.java | 10 +- .../caf/generator/enumGen/EnumGenerator.java | 10 +- .../enumGen/EnumGeneratorContext.java | 10 +- .../caf/generator/field/FieldGenerator.java | 10 +- .../field/FieldGeneratorContext.java | 10 +- .../caf/generator/item/ClassGenerator.java | 10 +- .../generator/item/ClassGeneratorContext.java | 10 +- .../generator/item/InterfaceGenerator.java | 10 +- .../item/InterfaceGeneratorContext.java | 10 +- .../generator/item/ItemGeneratorContext.java | 10 +- .../caf/generator/item/ItemInfoGenerator.java | 10 +- .../method/ClassMethodGenerator.java | 10 +- .../method/ClassMethodGeneratorContext.java | 10 +- .../method/GetterMethodGenerator.java | 10 +- .../InterfaceGetterMethodGenerator.java | 10 +- .../method/InterfaceMethodGenerator.java | 10 +- .../InterfaceMethodGeneratorContext.java | 10 +- .../InterfaceSetterMethodGenerator.java | 10 +- .../caf/generator/method/MethodGenerator.java | 10 +- .../method/MethodGeneratorContext.java | 10 +- .../method/SetterMethodGenerator.java | 10 +- .../caf/generator/module/ModuleGenerator.java | 10 +- .../module/ModuleGeneratorContext.java | 10 +- .../property/ClassPropertyGenerator.java | 10 +- .../ClassPropertyGeneratorContext.java | 10 +- .../property/InterfacePropertyGenerator.java | 10 +- .../InterfacePropertyGeneratorContext.java | 10 +- .../generator/property/PropertyGenerator.java | 10 +- .../property/PropertyGeneratorContext.java | 10 +- .../caf/generator/utils/CompilerUtils.java | 10 +- .../caf/generator/utils/ExpressionUtils.java | 10 +- .../generator/utils/File4ComplierUtils.java | 10 +- .../iec/edp/caf/generator/utils/JarUtils.java | 10 +- caf-database-object-manager/pom.xml | 12 +- .../manager/DatabaseObjectServiceImpl.java | 16 +- .../config/DboDtServiceConfiguration.java | 10 +- .../export/DatabaseObjectExportManager.java | 23 +- .../DatabaseObjectExportServiceImpl.java | 10 +- .../manager/persistent/DatabaseObjectDac.java | 10 +- .../DatabaseObjectManagerRepository.java | 10 +- .../IDatabaseObjectManagerRepository.java | 10 +- .../manager/persistent/RepositoryFactory.java | 10 +- caf-database-object-rpcapi/pom.xml | 14 +- .../service/DatabaseObjectRpcService.java | 10 +- caf-database-object-rtmanager/pom.xml | 29 ++- .../rtmanager/DBOConfigDataCollectImpl.java | 38 +++ .../rtmanager/DBOConfigDataCopyImpl.java | 53 +++++ .../DatabaseObjectDeployServiceImpl.java | 16 +- .../DatabaseObjectDtServiceImpl.java | 35 +-- .../rtmanager/DatabaseObjectRtService.java | 220 ++++++++++++++++-- .../DatabaseObjectTempTableServiceImpl.java | 92 ++++++-- .../rtmanager/DboEventHandle.java | 16 -- .../DatabaseObjectRtServiceConfiguration.java | 34 ++- .../GspDatabaseColumnMappingRepository.java | 10 + .../GspDatabaseObjectDtRepository.java | 10 +- .../GspDatabaseObjectMappingRepository.java | 11 + .../GspDatabaseObjectRepository.java | 16 +- .../rpc/DatabaseObjectRpcServiceImpl.java | 10 +- .../rtmanager/rpc/DboSerializer.java | 10 +- caf-database-object-rttest/pom.xml | 26 ++- .../DatabaseObjectRtTestServiceImpl.java | 57 ++++- .../api/IDatabaseObjectRtTestService.java | 86 +++++-- ...abaseObjectRtTestServiceConfiguration.java | 10 +- caf-database-object-spi/pom.xml | 36 +++ .../spi/ITableNameRuleManager.java | 31 +++ caf-name-rule-extend/pom.xml | 12 +- .../DboTableNameExtendManager.java | 19 +- pom.xml | 14 +- style/ubml_checkstyle.xml | 10 +- 155 files changed, 1655 insertions(+), 1053 deletions(-) create mode 100644 caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OpenGaussDatabase.java create mode 100644 caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboException.java create mode 100644 caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboExceptionCode.java create mode 100644 caf-database-object-deploy-gaussgenerator/pom.xml create mode 100644 caf-database-object-deploy-gaussgenerator/src/main/java/io/iec/edp/caf/databaseobject/gaussgenerator/OpenGaussSqlGenerator.java create mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java create mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java create mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseColumnMappingRepository.java create mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectMappingRepository.java create mode 100644 caf-database-object-spi/pom.xml create mode 100644 caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java diff --git a/caf-database-object-common/pom.xml b/caf-database-object-common/pom.xml index e866fea..5150885 100644 --- a/caf-database-object-common/pom.xml +++ b/caf-database-object-common/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 jar @@ -66,7 +64,7 @@ io.iec.edp caf-context-api 1.0.0-rc.1 - compile + provided diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCheckUtil.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCheckUtil.java index f4c7785..6bc05fd 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCheckUtil.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCheckUtil.java @@ -1,26 +1,24 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common; -import io.iec.edp.caf.databaseobject.api.entity.*; -import io.iec.edp.caf.databaseobject.common.helper.ObjectMaxLengthHelper; import io.iec.edp.caf.databaseobject.api.configuration.ObjectNameMaxLengthConfiguration; import io.iec.edp.caf.databaseobject.api.context.DatabaseObjectReservedWords; import io.iec.edp.caf.databaseobject.api.context.DatabaseReservedWords; +import io.iec.edp.caf.databaseobject.api.entity.*; +import io.iec.edp.caf.databaseobject.common.helper.ObjectMaxLengthHelper; import java.io.IOException; import java.util.HashMap; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCommonUtil.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCommonUtil.java index 58fd0bd..59cb2ee 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCommonUtil.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/DatabaseObjectCommonUtil.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common; @@ -38,7 +36,10 @@ import java.io.IOException; import java.lang.reflect.Field; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -47,6 +48,7 @@ import java.util.stream.Collectors; @Slf4j public class DatabaseObjectCommonUtil { private static List languages; + public static boolean isToolEntrance = false; public final AbstractDatabaseObject deserialze(String content) throws IOException { ObjectMapper mapper = new ObjectMapper(); @@ -654,6 +656,8 @@ public class DatabaseObjectCommonUtil { dbInfo.setDbType(DbType.Kingbase); } else if (t.equals("db2")) { dbInfo.setDbType(DbType.DB2); + } else if (t.equals("opengauss")) { + dbInfo.setDbType(DbType.OpenGauss); } return dbInfo; @@ -683,7 +687,7 @@ public class DatabaseObjectCommonUtil { String sql = null; if (db.getDbType() == DbType.Oracle || db.getDbType() == DbType.DM || db.getDbType() == DbType.Oscar) { sql = "select table_name from user_tables"; - } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo) { + } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.OpenGauss) { sql = "select tablename from pg_tables where lower(schemaname)='" + db.getUserName().toLowerCase() + "'"; } else if (db.getDbType() == DbType.MySQL) { sql = "select TABLE_NAME from information_schema.TABLES where TABLE_TYPE='BASE TABLE' and LOWER(TABLE_SCHEMA)='" + db.getDbName().toLowerCase() + "'"; @@ -723,37 +727,62 @@ public class DatabaseObjectCommonUtil { return tables; } + /** - * 判断系统中临时表是否存在 + * 获取系统中的表 * * @param db db * @return 表名 */ - public static boolean tempTableIsExist(DBInfo db,String tableName) { - boolean result=false; + public List getDbTables(DBInfo db, List tableNames) { String sql = null; + String whereSql = null; if (db.getDbType() == DbType.Oracle || db.getDbType() == DbType.DM || db.getDbType() == DbType.Oscar) { - sql = "select OBJECT_NAME from ALL_OBJECTS where temporary = 'Y' and OBJECT_NAME = '"+tableName+"'"; - } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo) { - sql = "select relname from pg_class where relname='"+tableName+"'"; + sql = "select table_name from user_tables"; + whereSql = " where table_name in"; + } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.OpenGauss) { + sql = "select tablename from pg_tables where lower(schemaname)='" + db.getUserName().toLowerCase() + "'"; + whereSql = " and tablename in"; } else if (db.getDbType() == DbType.MySQL) { - return false; + sql = "select TABLE_NAME from information_schema.TABLES where TABLE_TYPE='BASE TABLE' and LOWER(TABLE_SCHEMA)='" + db.getDbName().toLowerCase() + "'"; + whereSql = " and TABLE_NAME in"; } else if (db.getDbType() == DbType.SQLServer) { - sql = "select object_id(N'tempdb.."+tableName+"',N'U')"; + sql = "select name from sysObjects where xtype='U'"; + whereSql = " and LOWER(name) in"; } else if (db.getDbType() == DbType.Kingbase) { - sql = "select 1 from sys_tables where tablename = '"+tableName+"'"; + sql = "select table_name from user_tables"; + whereSql = " where LOWER(table_name) in"; } else if (db.getDbType() == DbType.DB2) { - return false; + sql = "SELECT TABNAME FROM SYSCAT.TABLES WHERE TABSCHEMA='" + db.getUserName().toUpperCase() + "'"; + whereSql = " and TABNAME IN"; } else { - return false; + return new ArrayList<>(); } + if(tableNames!=null && tableNames.size()>0){ + String inSql = "("; + int count=0; + for (String tname : tableNames) { + if(DbType.Oracle.equals(db.getDbType()) || DbType.Oscar.equals(db.getDbType()) || DbType.DB2.equals(db.getDbType()) || DbType.DM.equals(db.getDbType())){ + tname = tname.toUpperCase(); + }else if(DbType.PgSQL.equals(db.getDbType())|| DbType.HighGo.equals(db.getDbType()) || DbType.MySQL.equals(db.getDbType()) || DbType.OpenGauss.equals(db.getDbType()) || DbType.SQLServer.equals(db.getDbType())|| DbType.Kingbase.equals(db.getDbType())){ + tname = tname.toLowerCase(); + } + inSql = inSql + "'" + tname + "',"; + } + inSql = inSql.substring(0, inSql.length() - 1); + inSql = inSql + ")"; + sql = sql +whereSql+inSql; + } + List tables = new ArrayList<>(); GspDatabase gspDatabase = GspDbFactory.getDatabase(db); ResultSet resultSet = null; + String tableName = null; try { resultSet = gspDatabase.executeResultSet(sql); if (resultSet != null) { - if(resultSet.next()){ - result=true; + while (resultSet.next()) { + tableName = resultSet.getString(1); + tables.add(tableName); } } } catch (Exception e) { @@ -768,7 +797,33 @@ public class DatabaseObjectCommonUtil { } gspDatabase.close(); } - return result; + return tables; + } + + /** + * 获取系统中临时表名 + * + * @param db db + * @return 表名 + */ + public static String tempTableIsExist(DBInfo db, String tableName) { + String sql = ""; + if (db.getDbType() == DbType.Oracle || db.getDbType() == DbType.DM || db.getDbType() == DbType.Oscar) { + sql = "select OBJECT_NAME from ALL_OBJECTS where temporary = 'Y' and OBJECT_NAME = '"+tableName.toUpperCase()+"'"; + } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.OpenGauss) { + sql = "select tablename from (select to_regclass('"+tableName.toLowerCase()+"') as tablename) t where tablename is not null"; + } else if (db.getDbType() == DbType.MySQL) { + return ""; + } else if (db.getDbType() == DbType.SQLServer) { + sql = "select object_id(N'tempdb.."+tableName+"',N'U') as id"; + } else if (db.getDbType() == DbType.Kingbase) { + sql = "select 1 from sys_tables where tablename = '"+tableName.toLowerCase()+"'"; + } else if (db.getDbType() == DbType.DB2) { + return ""; + } else { + return ""; + } + return sql; } /** @@ -783,7 +838,7 @@ public class DatabaseObjectCommonUtil { String sql = null; if (db.getDbType() == DbType.Oracle || db.getDbType() == DbType.DM || db.getDbType() == DbType.Oscar) { sql = "SELECT COUNT(1) FROM USER_TAB_COLS WHERE COLUMN_NAME = '" + filed.toUpperCase() + "' AND TABLE_NAME ='" + table.toUpperCase() + "'"; - } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo) { + } else if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.OpenGauss) { sql = "SELECT COUNT(1) FROM INFORMATION_SCHEMA.COLUMNS WHERE LOWER(TABLE_NAME) = '" + table.toLowerCase() + "' AND LOWER(COLUMN_NAME) = '" + filed.toLowerCase() + "' AND LOWER(TABLE_SCHEMA) = '" + db.getUserName().toLowerCase() + "'"; } else if (db.getDbType() == DbType.MySQL) { sql = "SELECT COUNT(1) FROM information_schema.columns WHERE table_name='" + table.toLowerCase() + "' AND column_name='" + filed.toLowerCase() + "' AND TABLE_SCHEMA = '" + db.getDbName().toLowerCase() + "'"; @@ -792,7 +847,7 @@ public class DatabaseObjectCommonUtil { } else if (db.getDbType() == DbType.Kingbase) { sql = "SELECT COUNT(1) FROM USER_TAB_COLS WHERE LOWER(COLUMN_NAME) = '" + filed.toLowerCase() + "' AND LOWER(TABLE_NAME) ='" + table.toLowerCase() + "'"; } else if (db.getDbType() == DbType.DB2) { - sql = "SELECT COUNT(1) FROM SYSCAT.COLUMNS WHERE TABNAME = '" + filed.toUpperCase() + "' AND COLNAME ='" + table.toUpperCase() + "'"; + sql = "SELECT COUNT(1) FROM SYSCAT.COLUMNS WHERE TABNAME = '" + table.toUpperCase() + "' AND COLNAME ='" + filed.toUpperCase() + "'"; } GspDatabase gspDatabase = GspDbFactory.getDatabase(db); ResultSet resultSet = null; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/cache/DatabaseObjectCacheManager.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/cache/DatabaseObjectCacheManager.java index 7f865e5..2ce0341 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/cache/DatabaseObjectCacheManager.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/cache/DatabaseObjectCacheManager.java @@ -1,29 +1,27 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.cache; -import com.alibaba.fastjson.JSON; import io.iec.edp.caf.boot.context.CAFContext; import io.iec.edp.caf.commons.utils.SpringBeanUtils; import io.iec.edp.caf.databaseobject.api.entity.AbstractDatabaseObject; +import io.iec.edp.caf.databaseobject.api.entity.DatabaseObjectTable; +import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; import lombok.extern.slf4j.Slf4j; import javax.persistence.EntityManager; - import java.sql.Timestamp; import java.time.Instant; import java.util.HashMap; @@ -40,6 +38,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; @Slf4j public class DatabaseObjectCacheManager { private static Map dboCache; + public static Map mappingCache = new ConcurrentHashMap<>(); + public static Map idmappingCache = new ConcurrentHashMap<>(); private static DatabaseObjectCacheManager instance; private Instant cacheInstant = Instant.now(); @@ -100,6 +100,13 @@ public class DatabaseObjectCacheManager { String dboId = key; //支持多租户 key = key + CAFContext.current.getTenantId(); + if(key.contains("#mapping")){ + if(dboCache.get(key)!=null){ + return dboCache.get(key); + }else{ + return null; + } + } if (dboTimeCacheInstant.containsKey(key)) { if (Instant.now().isAfter(dboTimeCacheInstant.get(key))) { AbstractDatabaseObject object = dboCache.get(key); @@ -170,6 +177,10 @@ public class DatabaseObjectCacheManager { /// 主键值 public void removeDatabaseObjectContent(String key) { + if(DatabaseObjectCommonUtil.isToolEntrance) + { + return; + } key = key + CAFContext.current.getTenantId(); dboCache.remove(key); } diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/AbstractDatabaseImpl.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/AbstractDatabaseImpl.java index 64439b7..a6f28f1 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/AbstractDatabaseImpl.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/AbstractDatabaseImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DB2Database.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DB2Database.java index ce379cc..8b9572f 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DB2Database.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DB2Database.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DMDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DMDatabase.java index a8576f0..902c231 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DMDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DMDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DbConfigData.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DbConfigData.java index 22370e9..8321c2c 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DbConfigData.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/DbConfigData.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDatabase.java index d4775ae..5a21e98 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDbFactory.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDbFactory.java index 4708a1c..aa4c717 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDbFactory.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/GspDbFactory.java @@ -1,23 +1,20 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; import io.iec.edp.caf.databaseobject.api.entity.DBInfo; -import lombok.var; /** * @author liu_wei @@ -44,6 +41,8 @@ public class GspDbFactory { return new KingbaseDatabase(configData); case DB2: return new DB2Database(configData); + case OpenGauss: + return new OpenGaussDatabase(configData); default: throw new RuntimeException("数据库类型不正确:" + configData.getDbType()); } diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/HighGoDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/HighGoDatabase.java index 5e77b23..8abd574 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/HighGoDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/HighGoDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/KingbaseDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/KingbaseDatabase.java index 6578aa5..c2ed8b3 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/KingbaseDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/KingbaseDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/MySQLDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/MySQLDatabase.java index 7f21290..caba6f4 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/MySQLDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/MySQLDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OpenGaussDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OpenGaussDatabase.java new file mode 100644 index 0000000..94cffc6 --- /dev/null +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OpenGaussDatabase.java @@ -0,0 +1,27 @@ +package io.iec.edp.caf.databaseobject.common.database; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class OpenGaussDatabase extends AbstractDatabaseImpl { + + public OpenGaussDatabase(DbConfigData configData) { + super(configData); + } + + @Override + public Connection getConnection(DbConfigData configData) throws SQLException { + Connection c = null; + String url = configData.getConnectionString(); + + try { + Class.forName("org.opengauss.Driver"); + c = DriverManager.getConnection(url, configData.getUserId(), configData.getPassword()); + } catch (ClassNotFoundException e) { + throw new RuntimeException("构造GUSSDB数据库连接出错,找不到Driver:" + e); + } + + return c; + } +} \ No newline at end of file diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OracleDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OracleDatabase.java index a1caac0..78230f6 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OracleDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OracleDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OscarDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OscarDatabase.java index 5164dc1..502af5f 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OscarDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/OscarDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/PostgreSQLDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/PostgreSQLDatabase.java index c29c2e9..a9b19b7 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/PostgreSQLDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/PostgreSQLDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/SQLServerDatabase.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/SQLServerDatabase.java index a63c60d..b7d7220 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/SQLServerDatabase.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/database/SQLServerDatabase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.database; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboException.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboException.java new file mode 100644 index 0000000..a772157 --- /dev/null +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboException.java @@ -0,0 +1,38 @@ +package io.iec.edp.caf.databaseobject.common.exception; + +import io.iec.edp.caf.commons.exception.CAFRuntimeException; +import io.iec.edp.caf.commons.exception.ExceptionLevel; + +/** + * @author xuefengping + * @date 2023/5/22 18:21 + */ +public class DboException extends CAFRuntimeException { + public DboException(String serviceUnitCode, String resourceFile, String exceptionCode, String[] messageParams, Exception innerException) { + super(serviceUnitCode, resourceFile, exceptionCode, messageParams, innerException); + } + + public DboException(String serviceUnitCode, String resourceFile, String exceptionCode, String[] messageParams, Exception innerException, ExceptionLevel level) { + super(serviceUnitCode, resourceFile, exceptionCode, messageParams, innerException, level); + } + + public DboException(String serviceUnitCode, String resourceFile, String exceptionCode, String[] messageParams, Exception innerException, ExceptionLevel level, boolean bizException) { + super(serviceUnitCode, resourceFile, exceptionCode, messageParams, innerException, level, bizException); + } + + public DboException(String serviceUnitCode, String exceptionCode, String message, Exception innerException) { + super(serviceUnitCode, exceptionCode, message, innerException); + } + + public DboException(String serviceUnitCode, String exceptionCode, String message, Exception innerException, ExceptionLevel level) { + super(serviceUnitCode, exceptionCode, message, innerException, level); + } + + public DboException(String serviceUnitCode, String exceptionCode, String message, Exception innerException, ExceptionLevel level, boolean bizException) { + super(serviceUnitCode, exceptionCode, message, innerException, level, bizException); + } + + public DboException(String exceptionCode, String message, Exception innerException, ExceptionLevel level, boolean bizException) { + super("Sys", exceptionCode, message, innerException, level, bizException); + } +} diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboExceptionCode.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboExceptionCode.java new file mode 100644 index 0000000..c8748cc --- /dev/null +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/exception/DboExceptionCode.java @@ -0,0 +1,17 @@ +package io.iec.edp.caf.databaseobject.common.exception; + +/** + * @author xuefengping + * @date 2023/5/22 18:20 + */ +public class DboExceptionCode { + /** + * + */ + public static final String JudgeFailed = "GSP_DBO_0001"; + /** + * + */ + public static final String DeleteDboRecordError = "GSP_DBO_0002"; + +} diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/ObjectMaxLengthHelper.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/ObjectMaxLengthHelper.java index b414d8e..46c515c 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/ObjectMaxLengthHelper.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/ObjectMaxLengthHelper.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.helper; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/SQLReflectHelper.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/SQLReflectHelper.java index eb4a67d..122be01 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/SQLReflectHelper.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/SQLReflectHelper.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.helper; diff --git a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/TableNameHelper.java b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/TableNameHelper.java index b01f0e4..f7e1ece 100644 --- a/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/TableNameHelper.java +++ b/caf-database-object-common/src/main/java/io/iec/edp/caf/databaseobject/common/helper/TableNameHelper.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.common.helper; diff --git a/caf-database-object-deploy-gaussgenerator/pom.xml b/caf-database-object-deploy-gaussgenerator/pom.xml new file mode 100644 index 0000000..de70e8b --- /dev/null +++ b/caf-database-object-deploy-gaussgenerator/pom.xml @@ -0,0 +1,35 @@ + + + + + + caf-database-object + io.iec.edp + 0.3.0 + + 4.0.0 + + caf-database-object-deploy-gaussgenerator + + + io.iec.edp + caf-database-object-deploy-defaultsqlgenerator + ${project.version} + compile + + + diff --git a/caf-database-object-deploy-gaussgenerator/src/main/java/io/iec/edp/caf/databaseobject/gaussgenerator/OpenGaussSqlGenerator.java b/caf-database-object-deploy-gaussgenerator/src/main/java/io/iec/edp/caf/databaseobject/gaussgenerator/OpenGaussSqlGenerator.java new file mode 100644 index 0000000..678def4 --- /dev/null +++ b/caf-database-object-deploy-gaussgenerator/src/main/java/io/iec/edp/caf/databaseobject/gaussgenerator/OpenGaussSqlGenerator.java @@ -0,0 +1,40 @@ +/* + * Copyright © OpenAtom Foundation. + * 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 io.iec.edp.caf.databaseobject.gaussgenerator; + +import io.iec.edp.caf.databaseobject.defaultsqlgenerator.AbstractDefaultSqlGenerator; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author liu_wei + */ +public class OpenGaussSqlGenerator extends AbstractDefaultSqlGenerator { + @Override + public List GetViewSql(String viewName, String defination) { + List result = new ArrayList(); + String dropSql = "drop view if exists " + viewName; + result.add(dropSql); + String sql = "Create View " + viewName + " AS " + defination; + result.add(sql); + return result; + } + + @Override + public String getDefaultValue(String schemaName, String tableName, String colName) { + return "SELECT column_default AS defaultvalue FROM information_schema.columns WHERE table_schema= '" + schemaName + "' and table_name = '" + tableName + "' and column_name = '" + colName + "'"; + } +} diff --git a/caf-database-object-deploy-manager/pom.xml b/caf-database-object-deploy-manager/pom.xml index 459b609..acb6e9b 100644 --- a/caf-database-object-deploy-manager/pom.xml +++ b/caf-database-object-deploy-manager/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeConverter.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeConverter.java index f44a346..ecff4ba 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeConverter.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeConverter.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeUtil.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeUtil.java index ca6054b..f1acc5f 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeUtil.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DataTypeUtil.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DatabaseFuncConverter.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DatabaseFuncConverter.java index 873701c..4f6ede2 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DatabaseFuncConverter.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DatabaseFuncConverter.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployFileService.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployFileService.java index 7fe2262..013f9b5 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployFileService.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployFileService.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployManager.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployManager.java index 66cda14..b865b5d 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployManager.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboDeployManager.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; @@ -257,7 +255,9 @@ public class DboDeployManager { metadataSources.addAnnotatedClass(b); } MetadataBuilder metadataBuilder = metadataSources.getMetadataBuilder(); - metadataBuilder.applyPhysicalNamingStrategy(new DboPhysicalNamingStrategy()); + DboPhysicalNamingStrategy dboPhysicalNamingStrategy =new DboPhysicalNamingStrategy(); + dboPhysicalNamingStrategy.setDbType(dbType); + metadataBuilder.applyPhysicalNamingStrategy(dboPhysicalNamingStrategy); Metadata metadata = metadataBuilder.build(); tables = metadata.getDatabase().getDefaultNamespace().getTables(); @@ -268,7 +268,7 @@ public class DboDeployManager { for (String item : creatSql) { String sql = ""; if (StringUtils.isNotBlank(item)) { - if (info.getDbType() == DbType.PgSQL || info.getDbType() == DbType.HighGo) { + if (info.getDbType() == DbType.PgSQL || info.getDbType() == DbType.HighGo || info.getDbType() == DbType.OpenGauss) { sql = item.replace('\"' + table.getSchema() + '\"' + "." + table.getName(), table.getName()); sql = sql.replaceAll("(?i)TABLE", "TEMP TABLE") + " ON COMMIT PRESERVE ROWS"; } @@ -285,7 +285,7 @@ public class DboDeployManager { } if (info.getDbType() == DbType.MySQL) { sql = item.replace('\"' + table.getSchema() + '\"' + "." + table.getName(), table.getName()); - sql = sql.replaceAll("(?i)TABLE", "TEMPORARY TABLE"); + sql = sql.replaceAll("(?i)TABLE", "TEMPORARY TABLE IF NOT EXISTS"); } if (info.getDbType() == DbType.DB2) { sql = item.replace('\"' + table.getSchema() + '\"' + "." + table.getName(), table.getName()); @@ -326,11 +326,11 @@ public class DboDeployManager { private void monthDboDeployInit(List databaseObjects, List tables) { DatabaseObjectTable table; - DboTableChangeInfo dboTableChangeInfo; AbstractDatabaseObject localDatabaseObject; HashMap dbos = getDboFromDb(databaseObjects, dbInfo); DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); for (AbstractDatabaseObject databaseObject : databaseObjects) { + DboTableChangeInfo dboTableChangeInfo=null; localDatabaseObject = dbos.get(databaseObject.getId()); List currentDbTables = tables.stream().filter(x -> x.toLowerCase().startsWith(databaseObject.getCode().toLowerCase()) && x.length() == databaseObject.getCode().length() + 4).collect(Collectors.toList()); if (currentDbTables.size() > 0) { @@ -352,7 +352,8 @@ public class DboDeployManager { //列详细的修改动作 columnChangeOperations.put(table.getCode(), dboTableChangeInfo.getChangedColumnOperations()); columnChangedTables.put(table.getCode(), table); - + List updateSql = getUpdateColumnSql(table,dboTableChangeInfo); + SqlList.addAll(updateSql); String fileName = table.getCode() + UUID.randomUUID().toString().substring(0, 5); dboClasses.add(fileName); deployDatabaseObject(table, fileName, dboClasses.get(0)); @@ -387,7 +388,6 @@ public class DboDeployManager { } DatabaseObjectCheckUtil checkUtil = new DatabaseObjectCheckUtil(); DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); - DboTableChangeInfo dboTableChangeInfo = null; AbstractDatabaseObject localDatabaseObject = null; if (tables == null || tables.size() == 0) { tables = commonUtil.getDbTables(dbInfo); @@ -396,6 +396,7 @@ public class DboDeployManager { DatabaseObjectTable table = null; boolean isNewTable = false; for (AbstractDatabaseObject databaseObject : databaseObjects) { + DboTableChangeInfo dboTableChangeInfo = null; checkUtil.checkDatabaseObjectAvailable(databaseObject); if (databaseObject.getType() == DatabaseObjectType.Table) { isNewTable = false; @@ -430,6 +431,8 @@ public class DboDeployManager { String fileName = table.getCode() + UUID.randomUUID().toString().substring(0, 5); dboClasses.add(fileName); deployDatabaseObject(table, fileName, dboClasses.get(0)); + List updateSql = getUpdateColumnSql(table,dboTableChangeInfo); + SqlList.addAll(updateSql); if (table.isSynHis()) { DatabaseObjectTable hisTable = table.clone(); hisTable.setCode(hisTable.getCode() + "_His"); @@ -465,6 +468,28 @@ public class DboDeployManager { } } + private List getUpdateColumnSql(DatabaseObjectTable table, DboTableChangeInfo dboTableChangeInfo) { + List sqls = new ArrayList<>(); + List addColumns = new ArrayList<>(); + if(dboTableChangeInfo!=null){ + if(dboTableChangeInfo.getAddedColumn()!=null && dboTableChangeInfo.getAddedColumn().size()>0){ + addColumns.addAll(dboTableChangeInfo.getAddedColumn()); + } + } + if(DbType.SQLServer.equals(dbType) && addColumns !=null && addColumns.size()>0){ + for(DatabaseObjectColumn column:addColumns){ + List multiColumns = table.getMultiLanguageColumns(); + if(multiColumns!=null && multiColumns.size()>0 && multiColumns.contains(column.getId())){ + continue; + } + if(column.getDefaultValue()!=null && column.getDefaultValue()!=""){ + sqls.add("update "+table.getCode()+ " set " + column.getCode() + " = " + "\'"+column.getDefaultValue()+"\'"); + } + } + } + return sqls; + } + private boolean isExistTable(List tables, String table) { for (String obj : tables) { if (obj.equalsIgnoreCase(table)) { @@ -578,6 +603,11 @@ public class DboDeployManager { } private DatabaseObjectTable changeTableInfo(DatabaseObjectTable table, Map dimensionInfo) { + List indexes = table.getIndexes(); + Map> columnMap = new HashMap<>(); + for(DatabaseObjectIndex index:indexes){ + columnMap.put(index.getId(),index.getColumns()); + } DatabaseObjectCheckUtil checkUtil = new DatabaseObjectCheckUtil(); if (table.getHasNameRule()) { String name = getTableName(table.getCode(), table.getDboTableNameRule(), dimensionInfo); @@ -596,6 +626,19 @@ public class DboDeployManager { List languages = DatabaseObjectCommonUtil.getLanguages(); for (String columnId : table.getMultiLanguageColumns()) { DatabaseObjectColumn column = table.getColumnById(columnId); + for(DatabaseObjectIndex index:indexes){ + Optional column1 =columnMap.get(index.getId()).stream().filter(t->t.getId().equals(column.getId())).findFirst(); + if(column1.isPresent()){ + for(DatabaseObjectColumn column2:index.getColumns()){ + if(column1.get().getId().equals(column2.getId())){ + String code = column2.getCode()+"_CHS"; + String name = column2.getName()+"CHS"; + column2.setCode(code); + column2.setName(name); + } + } + } + } column.setNullable(true); column.setUnique(false); for (String language : languages) { @@ -676,6 +719,10 @@ public class DboDeployManager { serviceRegistryBuilder.applySetting("hibernate.default_schema", "[" + dbInfo.getUserName().toUpperCase() + "]"); serviceRegistryBuilder.applySetting("hibernate.connection.driver_class", "com.ibm.db2.jcc.DB2Driver"); serviceRegistryBuilder.applySetting("hibernate.dialect", "org.hibernate.dialect.DB2Dialect"); + } else if (dbType == DbType.OpenGauss) { + serviceRegistryBuilder.applySetting("hibernate.default_schema", "[" + dbInfo.getUserName() + "]"); + serviceRegistryBuilder.applySetting("hibernate.connection.driver_class", "org.opengauss.Driver"); + serviceRegistryBuilder.applySetting("hibernate.dialect", "org.hibernate.dialect.PostgreSQL95Dialect"); } } @@ -727,7 +774,9 @@ public class DboDeployManager { } MetadataBuilder metadataBuilder = metadataSources.getMetadataBuilder(); //在真正执行部署时,需要再次指定表名规则,否则不生效 - metadataBuilder.applyPhysicalNamingStrategy(new DboPhysicalNamingStrategy()); + DboPhysicalNamingStrategy dboPhysicalNamingStrategy =new DboPhysicalNamingStrategy(); + dboPhysicalNamingStrategy.setDbType(dbType); + metadataBuilder.applyPhysicalNamingStrategy(dboPhysicalNamingStrategy); metadata = metadataBuilder.build(); //同步表结构出错hibernate只抛出warn,需要手工捕获 //catchSqlWarn(); @@ -851,7 +900,7 @@ public class DboDeployManager { } //pg、highgo数据库,需要先移除视图依赖 List depViews = null; - if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo) { + if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.OpenGauss) { if (views == null) { views = getViews(db); } @@ -862,7 +911,7 @@ public class DboDeployManager { //执行修改列sql exeSqls(allColumnSqls); //pg、highgo数据库,创建上依赖的视图 - if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo) { + if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() ==DbType.OpenGauss) { createDependentViews(depViews); } } @@ -977,14 +1026,14 @@ public class DboDeployManager { return new HashMap<>(); } String inSql = "("; - boolean flag=databaseObjcts.size()>1000?true:false; + boolean flag=databaseObjects.size()>1000?true:false; int count=0; for (AbstractDatabaseObject databaseObject : databaseObjects) { if (databaseObject.getType() != DatabaseObjectType.Table) { continue; } if(++count%1000==0 && flag==true){ - inSql = inSql + "'" + databaseObject.getId() + "')" +" and id in ("; + inSql = inSql + "'" + databaseObject.getId() + "')" + " and id in ("; }else{ inSql = inSql + "'" + databaseObject.getId() + "',"; } @@ -1044,7 +1093,9 @@ public class DboDeployManager { MetadataSources metadataSources = new MetadataSources(serviceRegistry); metadataSources.addAnnotatedClass(GspDatabaseObject.class); MetadataBuilder metadataBuilder = metadataSources.getMetadataBuilder(); - metadataBuilder.applyPhysicalNamingStrategy(new DboPhysicalNamingStrategy()); + DboPhysicalNamingStrategy dboPhysicalNamingStrategy = new DboPhysicalNamingStrategy(); + dboPhysicalNamingStrategy.setDbType(dbType); + metadataBuilder.applyPhysicalNamingStrategy(dboPhysicalNamingStrategy); Metadata metadata = metadataBuilder.build(); sessionFactory = metadata.buildSessionFactory(); } @@ -1126,6 +1177,16 @@ public class DboDeployManager { this.dbType = dbInfo.getDbType(); applySetting(); + DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); + List tables = commonUtil.getDbTables(dbInfo); + //判断是否包含月度表 + List monthDboList = databaseObjects.stream().filter(x -> x.getType() == DatabaseObjectType.Table && ((DatabaseObjectTable) x).getHasNameRule() && ((DatabaseObjectTable) x).getDboTableNameRule().getCode().equalsIgnoreCase("YYMM")).collect(Collectors.toList()); + if (monthDboList.size() > 0) { + List dboIds = monthDboList.stream().map(AbstractDatabaseObject::getId).collect(Collectors.toList()); + databaseObjects.removeIf(x -> dboIds.contains(x.getId())); + monthDboDeployInit(monthDboList, tables); + } + for (Map dimensionInfo : list) { dbosDeployInitForDbSetup(databaseObjects, dimensionInfo); } diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboPhysicalNamingStrategy.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboPhysicalNamingStrategy.java index 561ccea..5040497 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboPhysicalNamingStrategy.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/DboPhysicalNamingStrategy.java @@ -1,21 +1,20 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; +import io.iec.edp.caf.databaseobject.api.entity.DbType; import org.hibernate.boot.model.naming.Identifier; import org.hibernate.boot.model.naming.PhysicalNamingStrategy; import org.hibernate.dialect.Dialect; @@ -27,6 +26,13 @@ import java.util.Locale; * @author liu_wei */ public class DboPhysicalNamingStrategy implements PhysicalNamingStrategy { + + private DbType dbType; + + public void setDbType(DbType dbType){ + this.dbType = dbType; + } + @Override public Identifier toPhysicalCatalogName(Identifier name, JdbcEnvironment jdbcEnvironment) { return apply(name, true, jdbcEnvironment); @@ -116,7 +122,9 @@ public class DboPhysicalNamingStrategy implements PhysicalNamingStrategy { String[] arr = dialect.toString().split("\\."); String name = arr[arr.length - 1].toLowerCase(Locale.ROOT); - + if(DbType.OpenGauss.equals(dbType)){ + return LetterCase.lowerCase; + } if (name.contains("postgresql") || name.contains("hgdbdialect") || name.contains("mysql")) { return LetterCase.lowerCase; } else if (name.contains("oracle") || name.contains("dm") || name.contains("oscar") || name.contains("db2")) { diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/LetterCase.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/LetterCase.java index 38c63b0..e6554cd 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/LetterCase.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/LetterCase.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassConstrutorWhitNoArgGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassConstrutorWhitNoArgGenerator.java index c121af8..fd49eff 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassConstrutorWhitNoArgGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassConstrutorWhitNoArgGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerateContext.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerateContext.java index 28d4b21..639884b 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerateContext.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerateContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerator.java index f62fdda..08954e8 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassMethodGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassMethodGenerator.java index ec46dfe..1c5f9ce 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassMethodGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboClassMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGenerator.java index 8806dfe..83a2cd8 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGeneratorContext.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGeneratorContext.java index 32a8727..87de851 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGeneratorContext.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboCompileUnitGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboFieldGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboFieldGenerator.java index 4aa1213..2e457d7 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboFieldGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboFieldGenerator.java @@ -1,21 +1,20 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; +import io.iec.edp.caf.databaseobject.api.configuration.FileUtils; import io.iec.edp.caf.generator.baseInfo.AnnotationInfo; import io.iec.edp.caf.generator.baseInfo.AnnotationType; import io.iec.edp.caf.generator.baseInfo.TypeInfo; @@ -128,10 +127,13 @@ public class DboFieldGenerator extends FieldGenerator { if (dbType == DbType.MySQL) { nameStringLiteral.setLiteralValue("\"" + column.getCode().toLowerCase() + "\""); } else if (dbType == DbType.DM) { - if (column.getCode().equalsIgnoreCase("context")) { + if (column.getCode().equalsIgnoreCase("context") || column.getCode().equalsIgnoreCase("explain")) { nameStringLiteral.setLiteralValue("\"" + column.getCode().toUpperCase() + "\""); } - } else { + } else if(dbType == DbType.OpenGauss || dbType ==DbType.PgSQL) { + nameStringLiteral.setLiteralValue("\"" + column.getCode().toLowerCase() + "\""); + } + else { nameStringLiteral.setLiteralValue(column.getCode()); } map.put("name", nameStringLiteral); @@ -156,6 +158,32 @@ public class DboFieldGenerator extends FieldGenerator { private String getDataTypeStr() { String type = ""; + //从DBO层面适配Oracle的UTF8字符集,扩1.5倍,来源于ZJ、ZYHY会议决定 + if(FileUtils.isUTF8ExtOpen()){ + if(dbType == DbType.Oracle) + { + if(column.getDataType() == DataType.Varchar && column.getLength() <= 4000) + { + if(column.getLength() >= 2667) + { + column.setLength(4000); + } + else { + column.setLength((int)(Math.ceil(column.getLength() * 1.5))); + } + } + if(column.getDataType() == DataType.NVarchar && column.getLength() <= 2000) + { + if(column.getLength() >= 1333) + { + column.setLength(2000); + } + else { + column.setLength((int)(Math.ceil(column.getLength() * 1.5))); + } + } + } + } if (dbType == DbType.Oracle && (column.getDataType() == DataType.Varchar || column.getDataType() == DataType.Char) && column.getLength() > 4000) { column.setDataType(DataType.Clob); column.setLength(0); @@ -211,13 +239,13 @@ public class DboFieldGenerator extends FieldGenerator { defaultStr += defaultValue; } else if (column.getDataType() == DataType.Boolean) { if (defaultValue.equalsIgnoreCase("0") || defaultValue.equalsIgnoreCase("false") || defaultValue.equalsIgnoreCase("f")) { - if (dbType == DbType.PgSQL || dbType == DbType.Oscar || dbType == DbType.Kingbase) { + if (dbType == DbType.PgSQL || dbType == DbType.Oscar || dbType == DbType.Kingbase || dbType == DbType.OpenGauss) { defaultStr += "false"; } else { defaultStr += "0"; } } else { - if (dbType == DbType.PgSQL || dbType == DbType.Oscar || dbType == DbType.Kingbase) { + if (dbType == DbType.PgSQL || dbType == DbType.Oscar || dbType == DbType.Kingbase || dbType == DbType.OpenGauss) { defaultStr += "true"; } else { defaultStr += "1"; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboMethodGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboMethodGenerator.java index b4e815e..ec4d57a 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboMethodGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGenerator.java index a1c4f56..e1a8cda 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; @@ -42,7 +40,8 @@ public class DboModuleGenerator extends ModuleGenerator { this.abstractDatabaseObject = abstractDatabaseObject; } - public DbType getDbType() { + public DbType getDbType() + { return dbType; } diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGeneratorContext.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGeneratorContext.java index d4f198b..7199e7a 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGeneratorContext.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/DboModuleGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGenerator.java index f5088d3..7ccd37c 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGeneratorContext.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGeneratorContext.java index 20a1900..5b64877 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGeneratorContext.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodGenerator.java index 3b3205a..0d93abd 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodWithoutParamGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodWithoutParamGenerator.java index 63f465d..e1e18d2 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodWithoutParamGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyClassMethodWithoutParamGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyFieldGenerator.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyFieldGenerator.java index b79b697..2b1f161 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyFieldGenerator.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/generate/PrimaryKeyFieldGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.generate; @@ -163,13 +161,13 @@ public class PrimaryKeyFieldGenerator extends FieldGenerator { defaultStr += defaultValue; } else if (column.getDataType() == DataType.Boolean) { if (defaultValue == "0" || defaultValue == "false" || defaultValue == "f") { - if (dbType == DbType.PgSQL || dbType == DbType.Kingbase) { + if (dbType == DbType.PgSQL || dbType == DbType.Kingbase || dbType == DbType.HighGo || dbType == DbType.OpenGauss) { defaultStr += "false"; } else { defaultStr += "0"; } } else { - if (dbType == DbType.PgSQL || dbType == DbType.Kingbase) { + if (dbType == DbType.PgSQL || dbType == DbType.Kingbase || dbType == DbType.HighGo || dbType == DbType.OpenGauss) { defaultStr += "true"; } else { defaultStr += "1"; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/helper/DboDeployConfigHelper.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/helper/DboDeployConfigHelper.java index 6f0583c..f3950c4 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/helper/DboDeployConfigHelper.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/helper/DboDeployConfigHelper.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.helper; diff --git a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/sqlprovider/SqlProvider.java b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/sqlprovider/SqlProvider.java index 1d9316c..16705bf 100644 --- a/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/sqlprovider/SqlProvider.java +++ b/caf-database-object-deploy-manager/src/main/java/io/iec/edp/caf/databaseobject/sqlprovider/SqlProvider.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.sqlprovider; @@ -248,7 +246,7 @@ public class SqlProvider { } for (String colunmName : columns) { //构造Sql - if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.Kingbase) { + if (db.getDbType() == DbType.PgSQL || db.getDbType() == DbType.HighGo || db.getDbType() == DbType.Kingbase || db.getDbType() == DbType.OpenGauss) { //alter table 表名 alter column 列名 数据类型 sql = "alter table " + table + " alter column " + colunmName + " type " + columnTypeAndLenthStr; sqls.add(sql); diff --git a/caf-database-object-deploy-spi/pom.xml b/caf-database-object-deploy-spi/pom.xml index bb0e9cf..d8c687a 100644 --- a/caf-database-object-deploy-spi/pom.xml +++ b/caf-database-object-deploy-spi/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 diff --git a/caf-database-object-deploy-spi/src/main/java/io/iec/edp/caf/databaseobject/IDatabaseObjectSQLReflect.java b/caf-database-object-deploy-spi/src/main/java/io/iec/edp/caf/databaseobject/IDatabaseObjectSQLReflect.java index f8868f8..01002d2 100644 --- a/caf-database-object-deploy-spi/src/main/java/io/iec/edp/caf/databaseobject/IDatabaseObjectSQLReflect.java +++ b/caf-database-object-deploy-spi/src/main/java/io/iec/edp/caf/databaseobject/IDatabaseObjectSQLReflect.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; diff --git a/caf-database-object-deploy/pom.xml b/caf-database-object-deploy/pom.xml index 1477a34..234a6fe 100644 --- a/caf-database-object-deploy/pom.xml +++ b/caf-database-object-deploy/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 @@ -31,7 +29,7 @@ io.iec.edp caf-database-object-api - 0.2.10 + 0.3.0 io.iec.edp diff --git a/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeploy.java b/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeploy.java index 68f4004..493af7a 100644 --- a/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeploy.java +++ b/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeploy.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject; @@ -22,6 +20,7 @@ import io.iec.edp.caf.commons.core.api.DataSerializer; import io.iec.edp.caf.commons.core.enums.SerializeType; import io.iec.edp.caf.databaseobject.api.entity.DBInfo; import io.iec.edp.caf.databaseobject.api.entity.DbType; +import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.Banner; import org.springframework.boot.CommandLineRunner; @@ -79,22 +78,45 @@ public class DboDeploy implements CommandLineRunner { @Override public void run(String... args) throws Exception { - boolean invoked = false; - - if (args.length > 0) { - if (Arrays.asList(args).contains("patch-tool-invoke")) { - invoked = true; + try{ + boolean invoked = false; + DatabaseObjectCommonUtil.isToolEntrance = true; + if (args.length > 0) { + if (Arrays.asList(args).contains("patch-tool-invoke")) { + invoked = true; + } } - } - if (invoked) { - while (true) { - DboDeployRequest request = getRequest(); - if (request == null) { - System.exit(0); - return; + if (invoked) { + while (true) { + DboDeployRequest request = getRequest(); + if (request == null) { + System.exit(0); + return; + } + isDbSetup = request.isDbSetup(); + getCmdParams(request.convertToArgs()); + dbInfo = new DBInfo(); + dbInfo.setDbName(dbName); + dbInfo.setDbType(dbType); + dbInfo.setPassWord(passWord); + dbInfo.setPort(port); + dbInfo.setServer(server); + dbInfo.setUserName(userName); + if (StringUtils.hasText(url)) { + dbInfo.setUrl(url); + } + dimensionInfo = new HashMap<>(); + dimensionInfo.put("FIYear", year); + deployCycleV2(); + } + } else { + boolean isCommand = false; + if (args.length > 1) { + getCmdParams(args); + isCommand = true; + } else { + getDbInfo(); } - isDbSetup = request.isDbSetup(); - getCmdParams(request.convertToArgs()); dbInfo = new DBInfo(); dbInfo.setDbName(dbName); dbInfo.setDbType(dbType); @@ -107,29 +129,10 @@ public class DboDeploy implements CommandLineRunner { } dimensionInfo = new HashMap<>(); dimensionInfo.put("FIYear", year); - deployCycleV2(); + deployCycle(isCommand); } - } else { - boolean isCommand = false; - if (args.length > 1) { - getCmdParams(args); - isCommand = true; - } else { - getDbInfo(); - } - dbInfo = new DBInfo(); - dbInfo.setDbName(dbName); - dbInfo.setDbType(dbType); - dbInfo.setPassWord(passWord); - dbInfo.setPort(port); - dbInfo.setServer(server); - dbInfo.setUserName(userName); - if (StringUtils.hasText(url)) { - dbInfo.setUrl(url); - } - dimensionInfo = new HashMap<>(); - dimensionInfo.put("FIYear", year); - deployCycle(isCommand); + }catch (Throwable e){ + log.error("dbo工具部署报错{}",e); } } @@ -195,7 +198,7 @@ public class DboDeploy implements CommandLineRunner { private static void getDbInfo() { Scanner scanner = new Scanner(System.in); getDBOPath(scanner); - System.out.println("请选择数据库类型:1.PgSql 2.SqlServer 3.Oracle 4.DM 5.Highgo 6.MySQL 7.Oscar 8.Kingbase 9.DB2 [1]"); + System.out.println("请选择数据库类型:1.PgSql 2.SqlServer 3.Oracle 4.DM 5.Highgo 6.MySQL 7.Oscar 8.Kingbase 9.DB2 10.OpenGauss[1]"); String type = scanner.nextLine(); checkDbType(type, scanner); @@ -279,6 +282,9 @@ public class DboDeploy implements CommandLineRunner { case DB2: defaultPort = "50000"; break; + case OpenGauss: + defaultPort = "5432"; + break; default: defaultPort = "5432"; break; @@ -316,6 +322,9 @@ public class DboDeploy implements CommandLineRunner { case DB2: defaultUserName = "db2inst1"; break; + case OpenGauss: + defaultUserName = "omm"; + break; default: defaultUserName = "postgres"; break; @@ -382,8 +391,11 @@ public class DboDeploy implements CommandLineRunner { } else if ("9".equals(type) || "DB2".equals(type)) { dbType = DbType.DB2; - } else { - System.out.println("请选择数据库类型:1.PgSql 2.SqlServer 3.Oracle 4.DM 5.Highgo 6.MySQL 7.Oscar 8.Kingbase 9.DB2 [1]"); + } else if ("10".equals(type) || "OpenGauss".equals(type)) { + dbType = DbType.OpenGauss; + + }else { + System.out.println("请选择数据库类型:1.PgSql 2.SqlServer 3.Oracle 4.DM 5.Highgo 6.MySQL 7.Oscar 8.Kingbase 9.DB2 10.OpenGauss[1]"); type = scanner.nextLine(); checkDbType(type, scanner); } diff --git a/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeployRequest.java b/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeployRequest.java index 501e8f2..0b71a0e 100644 --- a/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeployRequest.java +++ b/caf-database-object-deploy/src/main/java/io/iec/edp/caf/databaseobject/DboDeployRequest.java @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2020 - present, Inspur Genersoft Co., 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 io.iec.edp.caf.databaseobject; /** diff --git a/caf-database-object-generator/pom.xml b/caf-database-object-generator/pom.xml index c873f11..1a5d04f 100644 --- a/caf-database-object-generator/pom.xml +++ b/caf-database-object-generator/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGenerator.java index 0d0c6b7..b4be8ff 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGeneratorContext.java index 447f761..0f253a7 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/BaseGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGenerator.java index 0f1b268..cd261b7 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.annotation; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGeneratorContext.java index 336be0c..9ef10a2 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.annotation; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenContext.java index 2ce0b55..5a2691f 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.annotation; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenerator.java index ab46a07..d0f52b1 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/annotation/AnnotationMemberGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.annotation; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationInfo.java index 0018e69..f5b2b76 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationMemberInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationMemberInfo.java index 54cf073..d62f24c 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationMemberInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationMemberInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationType.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationType.java index c4a8bf0..2473519 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationType.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationType.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationTypeGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationTypeGenerateInfo.java index 42a8de4..803be1f 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationTypeGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/AnnotationTypeGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/BaseGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/BaseGenerateInfo.java index 3f9d048..b3278e5 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/BaseGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/BaseGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassGenerateInfo.java index f31d50d..05e6337 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassMethodGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassMethodGenerateInfo.java index 5b6ad3f..6ca20e3 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassMethodGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassMethodGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassPropertyGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassPropertyGenerateInfo.java index 7859d80..7833ced 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassPropertyGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ClassPropertyGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/CompilationUnitInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/CompilationUnitInfo.java index b280901..0df50ff 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/CompilationUnitInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/CompilationUnitInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumConstantInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumConstantInfo.java index e4cecdb..3041474 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumConstantInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumConstantInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumGenerateInfo.java index 66bd903..cc247d2 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/EnumGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/FieldGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/FieldGenerateInfo.java index 5890b51..1ce295d 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/FieldGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/FieldGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceGenerateInfo.java index 15d9186..224582b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceMethodGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceMethodGenerateInfo.java index 99b7b59..79da15b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceMethodGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfaceMethodGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfacePropertyGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfacePropertyGenerateInfo.java index 44b02b0..ee26b86 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfacePropertyGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/InterfacePropertyGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/MethodGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/MethodGenerateInfo.java index a93223e..a5ed850 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/MethodGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/MethodGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ModuleGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ModuleGenerateInfo.java index 41ab53b..4834c9b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ModuleGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ModuleGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ParameterInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ParameterInfo.java index 9252546..bddbff2 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ParameterInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/ParameterInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/PropertyGenerateInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/PropertyGenerateInfo.java index 9177ed4..6a48679 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/PropertyGenerateInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/PropertyGenerateInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeGeneratorInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeGeneratorInfo.java index 6e8a98e..dc28ad8 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeGeneratorInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeGeneratorInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeInfo.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeInfo.java index 9f7a4b8..185a89d 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeInfo.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/baseInfo/TypeInfo.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.baseInfo; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGenerator.java index ada11fd..2befe59 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.compileunit; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGeneratorContext.java index 108d1c1..56b63c7 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/compileunit/CompileUnitGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.compileunit; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGenerator.java index 8d2dde0..5fb700d 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.composite; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGeneratorContext.java index 78720c3..58a9567 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/composite/CompositeGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.composite; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGenerator.java index 56a24f0..62e8df9 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.enumGen; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGeneratorContext.java index 60b81df..2812140 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/enumGen/EnumGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.enumGen; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGenerator.java index 08b0737..fcf8a3d 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.field; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGeneratorContext.java index 6c54b96..2c2126a 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/field/FieldGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.field; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGenerator.java index 7ed27c6..0d938e7 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGeneratorContext.java index 6011507..689d105 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ClassGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGenerator.java index 536a14b..cc67f76 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGeneratorContext.java index 796cc5d..192f935 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/InterfaceGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemGeneratorContext.java index 38b9138..0fc7b3e 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemInfoGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemInfoGenerator.java index 24826cb..abe706b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemInfoGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/item/ItemInfoGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.item; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGenerator.java index f4c0bf6..3d84da8 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGeneratorContext.java index 80d94c4..b4905d9 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/ClassMethodGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/GetterMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/GetterMethodGenerator.java index 1963c2a..7a4b10a 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/GetterMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/GetterMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceGetterMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceGetterMethodGenerator.java index dbacda4..bc3c51d 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceGetterMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceGetterMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGenerator.java index 59e82be..4a5a9bc 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGeneratorContext.java index a8ab3cc..a43b56c 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceMethodGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceSetterMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceSetterMethodGenerator.java index fd73dfa..d52a6ce 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceSetterMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/InterfaceSetterMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGenerator.java index 20ed7fe..c30283c 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGeneratorContext.java index d6eb966..f023daf 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/MethodGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/SetterMethodGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/SetterMethodGenerator.java index 54bdc47..9bcf5fb 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/SetterMethodGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/method/SetterMethodGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.method; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGenerator.java index 5ecd783..5d2111b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.module; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGeneratorContext.java index c612f5b..651d499 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/module/ModuleGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.module; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGenerator.java index 5aafc18..aa0f41b 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGeneratorContext.java index 68f4fba..b2452c6 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/ClassPropertyGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGenerator.java index 4e969a6..2dacd2a 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGeneratorContext.java index 81954e0..a5904b6 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/InterfacePropertyGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGenerator.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGenerator.java index bbe2aa3..216b40c 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGenerator.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGenerator.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGeneratorContext.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGeneratorContext.java index eee209f..0c8dfc3 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGeneratorContext.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/property/PropertyGeneratorContext.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.property; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/CompilerUtils.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/CompilerUtils.java index c1e1de7..240ddc5 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/CompilerUtils.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/CompilerUtils.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.utils; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/ExpressionUtils.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/ExpressionUtils.java index 2dbbf50..a8d24a9 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/ExpressionUtils.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/ExpressionUtils.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.utils; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/File4ComplierUtils.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/File4ComplierUtils.java index e32e201..f3a6181 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/File4ComplierUtils.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/File4ComplierUtils.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.utils; diff --git a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/JarUtils.java b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/JarUtils.java index b03eb79..1959b60 100644 --- a/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/JarUtils.java +++ b/caf-database-object-generator/src/main/java/io/iec/edp/caf/generator/utils/JarUtils.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.generator.utils; diff --git a/caf-database-object-manager/pom.xml b/caf-database-object-manager/pom.xml index 965aed5..a6031b5 100644 --- a/caf-database-object-manager/pom.xml +++ b/caf-database-object-manager/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/DatabaseObjectServiceImpl.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/DatabaseObjectServiceImpl.java index 856c708..f0e1668 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/DatabaseObjectServiceImpl.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/DatabaseObjectServiceImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager; @@ -19,6 +17,7 @@ package io.iec.edp.caf.databaseobject.manager; import io.iec.edp.caf.databaseobject.api.context.DatabaseObjectContext; import io.iec.edp.caf.databaseobject.api.entity.*; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectService; +import io.iec.edp.caf.databaseobject.common.DatabaseObjectCheckUtil; import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; import io.iec.edp.caf.databaseobject.manager.persistent.RepositoryFactory; import org.apache.commons.lang3.StringUtils; @@ -45,6 +44,7 @@ public class DatabaseObjectServiceImpl implements IDatabaseObjectService { try { String content = RepositoryFactory.getInstance().getDatabaseObjectManagerRepository().read(fullPath); databaseObject = commonUtil.deserialze(content); + databaseObject = commonUtil.deserialze(databaseObject.getType(),content); } catch (Exception e) { throw new RuntimeException("根据路径获取数据库对象报错", e); } @@ -203,7 +203,9 @@ public class DatabaseObjectServiceImpl implements IDatabaseObjectService { try { databaseObject = commonUtil.deserialze(str); } catch (Exception e) { - throw new RuntimeException("反序列化数据库对象报错", e); + String[] splits=path.split("/|\\\\"); + String fileName=splits[splits.length-1]; + throw new RuntimeException("反序列化数据库对象"+fileName+"报错", e); } if (databaseObject != null) { result = new DatabaseObjectInfo(); diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/config/DboDtServiceConfiguration.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/config/DboDtServiceConfiguration.java index 3cd16da..8da176c 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/config/DboDtServiceConfiguration.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/config/DboDtServiceConfiguration.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.config; diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportManager.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportManager.java index 9a3339d..d8e9924 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportManager.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportManager.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.export; @@ -118,6 +116,10 @@ public class DatabaseObjectExportManager { serviceRegistryBuilder.applySetting("hibernate.default_schema", "[" + dbInfo.getUserName() + "]"); serviceRegistryBuilder.applySetting("hibernate.connection.driver_class", "com.ibm.db2.jcc.DB2Driver"); serviceRegistryBuilder.applySetting("hibernate.dialect", "org.hibernate.dialect.DB2Dialect"); + } else if (dbType == DbType.OpenGauss) { + serviceRegistryBuilder.applySetting("hibernate.default_schema", "[" + dbInfo.getUserName() + "]"); + serviceRegistryBuilder.applySetting("hibernate.connection.driver_class", "org.opengauss.Driver"); + serviceRegistryBuilder.applySetting("hibernate.dialect", "org.hibernate.dialect.PostgreSQL95Dialect"); } } @@ -175,7 +177,7 @@ public class DatabaseObjectExportManager { if (dbType == DbType.Oracle || dbType == DbType.DM || dbType == DbType.Oscar || dbType == DbType.DB2) { table = table.toUpperCase(); } - if (dbType == DbType.PgSQL || dbType == DbType.HighGo || dbType == DbType.MySQL) { + if (dbType == DbType.PgSQL || dbType == DbType.HighGo || dbType == DbType.MySQL || dbType==DbType.OpenGauss) { table = table.toLowerCase(); } String currentDboName = StringUtils.isNotBlank(dboName) ? dboName : table; @@ -208,7 +210,10 @@ public class DatabaseObjectExportManager { } String defaultValue = getDefaultValue(dbInfo.getUserName(), table, columnCode); boolean ifUnique = false; - boolean ifPK = columnInfo.getContainingTableInformation().getPrimaryKey().getColumns().iterator().next().getColumnIdentifier().getText().equals(columnCode); + boolean ifPK = false; + if(columnInfo.getContainingTableInformation().getPrimaryKey() != null){ + ifPK = columnInfo.getContainingTableInformation().getPrimaryKey().getColumns().iterator().next().getColumnIdentifier().getText().equals(columnCode); + } boolean isNullable = columnInfo.getNullable().toBoolean(true); boolean isI18n = false; objectTable.addColumn(columnId, columnCode, columnName, dataType, length, precision, scale, defaultValue, ifUnique, ifPK, isNullable, isI18n); @@ -298,7 +303,7 @@ public class DatabaseObjectExportManager { * @return DBO中支持的字段类型 */ private DataType getColumnDataType(ColumnInformation columnInfo) { - if (dbType == DbType.PgSQL || dbType == DbType.HighGo) { + if (dbType == DbType.PgSQL || dbType == DbType.HighGo || dbType == DbType.OpenGauss) { return getPgColumnDataType(columnInfo); } else if (dbType == DbType.SQLServer) { return getSqlServerColumnDataType(columnInfo); diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportServiceImpl.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportServiceImpl.java index 0833513..098b8de 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportServiceImpl.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/export/DatabaseObjectExportServiceImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.export; diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectDac.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectDac.java index 906ff8d..9070107 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectDac.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectDac.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.persistent; diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectManagerRepository.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectManagerRepository.java index 5787cca..512cea2 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectManagerRepository.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/DatabaseObjectManagerRepository.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.persistent; diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/IDatabaseObjectManagerRepository.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/IDatabaseObjectManagerRepository.java index a44d192..ec7633e 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/IDatabaseObjectManagerRepository.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/IDatabaseObjectManagerRepository.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.persistent; diff --git a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/RepositoryFactory.java b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/RepositoryFactory.java index 941511e..224f866 100644 --- a/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/RepositoryFactory.java +++ b/caf-database-object-manager/src/main/java/io/iec/edp/caf/databaseobject/manager/persistent/RepositoryFactory.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.manager.persistent; diff --git a/caf-database-object-rpcapi/pom.xml b/caf-database-object-rpcapi/pom.xml index 5f208bc..0fab2ce 100644 --- a/caf-database-object-rpcapi/pom.xml +++ b/caf-database-object-rpcapi/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 @@ -34,7 +32,7 @@ io.iec.edp caf-database-object-api - 0.2.10 + 0.3.0 compile diff --git a/caf-database-object-rpcapi/src/main/java/io/iec/edp/caf/databaseobject/rpcapi/service/DatabaseObjectRpcService.java b/caf-database-object-rpcapi/src/main/java/io/iec/edp/caf/databaseobject/rpcapi/service/DatabaseObjectRpcService.java index edbcf35..a6d00c3 100644 --- a/caf-database-object-rpcapi/src/main/java/io/iec/edp/caf/databaseobject/rpcapi/service/DatabaseObjectRpcService.java +++ b/caf-database-object-rpcapi/src/main/java/io/iec/edp/caf/databaseobject/rpcapi/service/DatabaseObjectRpcService.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rpcapi.service; diff --git a/caf-database-object-rtmanager/pom.xml b/caf-database-object-rtmanager/pom.xml index 1004fc2..5c8a4a4 100644 --- a/caf-database-object-rtmanager/pom.xml +++ b/caf-database-object-rtmanager/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 jar @@ -114,8 +112,23 @@ io.iec.edp caf-database-object-rpcapi - 0.2.10 + 0.3.0 compile + + com.inspur.edp + metadata-rtcustomization-api + 0.1.32 + + + com.inspur.edp + metadata-rtcustomization-context + 0.1.32 + + + com.inspur.edp + metadata-rtcustomization-spi + 0.1.32 + diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java new file mode 100644 index 0000000..a7ebaea --- /dev/null +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java @@ -0,0 +1,38 @@ +package io.iec.edp.caf.databaseobject.rtmanager; + +import com.inspur.edp.metadata.rtcustomization.api.entity.ConfigData; +import com.inspur.edp.metadata.rtcustomization.api.entity.MimicParamKeyEnum; +import com.inspur.edp.metadata.rtcustomization.api.entity.MimicTypeEnum; +import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCollectSpi; +import io.iec.edp.caf.commons.utils.SpringBeanUtils; +import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + + +public class DBOConfigDataCollectImpl implements ConfigDataCollectSpi { + private static final String DBO_TABLE_NAME = "gspdatabaseobject"; + private GspDatabaseObjectRepository repository = (GspDatabaseObjectRepository)SpringBeanUtils.getBean(GspDatabaseObjectRepository.class); + + public DBOConfigDataCollectImpl() { + } + + public List configDataCollect(Map map) { + String boid = (String)map.get(MimicParamKeyEnum.BO_ID); + List databaseObjects = this.repository.findAllByBusinessObjectId(boid); + List configDataList = new ArrayList(); + ConfigData configData = new ConfigData(); + configData.setTargetClass(GspDatabaseObject.class.getName()); + configData.setTableName("gspdatabaseobject"); + configData.setEntityList(databaseObjects); + configDataList.add(configData); + return configDataList; + } + + public MimicTypeEnum getMimicTypeEnum() { + return MimicTypeEnum.COMMON_APP_COPY; + } +} diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java new file mode 100644 index 0000000..4583078 --- /dev/null +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java @@ -0,0 +1,53 @@ +package io.iec.edp.caf.databaseobject.rtmanager; + +import com.inspur.edp.metadata.rtcustomization.api.entity.ConfigData; +import com.inspur.edp.metadata.rtcustomization.api.entity.MimicParamKeyEnum; +import com.inspur.edp.metadata.rtcustomization.api.entity.MimicTypeEnum; +import com.inspur.edp.metadata.rtcustomization.context.MimicServiceContextHolder; +import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCopySpi; +import io.iec.edp.caf.commons.utils.SpringBeanUtils; +import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +public class DBOConfigDataCopyImpl implements ConfigDataCopySpi { + private GspDatabaseObjectRepository repository = (GspDatabaseObjectRepository) SpringBeanUtils.getBean(GspDatabaseObjectRepository.class); + + private static final String DBO_TABLE_NAME = "gspdatabaseobject"; + + public DBOConfigDataCopyImpl() { + } + + public void configDataCopy(Map map, ConfigData configData) { + if (configData.getTableName().equals("gspdatabaseobject")) { + List entityList = (List) configData.getEntityList(); + Iterator var4 = entityList.iterator(); + + while(var4.hasNext()) { + Object obj = var4.next(); + if (obj instanceof GspDatabaseObject) { + GspDatabaseObject table = (GspDatabaseObject)obj; + String newId = UUID.randomUUID().toString(); + String key = "gspdatabaseobject_id_" + table.getId(); + MimicServiceContextHolder.saveConfigData(key, newId); + table.setId(newId); + String dboCode = table.getCode(); + table.setCode(dboCode + System.currentTimeMillis()); + String businessObjectId=MimicServiceContextHolder.findConfigDataNewValue("gspbusinessobject_id_"+table.getBusinessObjectId()); + table.setBusinessObjectId(businessObjectId); + repository.save(table); + } + } + } + + } + + public MimicTypeEnum getMimicTypeEnum() { + return MimicTypeEnum.COMMON_APP_COPY; + } +} + diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDeployServiceImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDeployServiceImpl.java index 74c35ad..d815724 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDeployServiceImpl.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDeployServiceImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager; @@ -66,6 +64,12 @@ public class DatabaseObjectDeployServiceImpl implements IDatabaseObjectDeploySer } + @Override + public DboDeployResultInfo deployDatabaseObjects(List databaseObjects, Map dimensionValue, DBInfo dbInfo) { + DboDeployManager dboDeployManager = new DboDeployManager(); + return dboDeployManager.deployDboList(databaseObjects, dimensionValue, dbInfo); + } + @Override public void modifyI18nDatabaseObjectsByNewLanguage(List languages) { IDatabaseObjectRtService databaseObjectRtService = SpringBeanUtils.getBean(IDatabaseObjectRtService.class); diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDtServiceImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDtServiceImpl.java index 71483f4..a41bc92 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDtServiceImpl.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectDtServiceImpl.java @@ -1,27 +1,28 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager; import io.iec.edp.caf.boot.context.CAFContext; +import io.iec.edp.caf.commons.exception.ExceptionLevel; import io.iec.edp.caf.commons.utils.SpringBeanUtils; import io.iec.edp.caf.databaseobject.api.entity.*; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDtService; import io.iec.edp.caf.databaseobject.common.DatabaseObjectCheckUtil; import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; +import io.iec.edp.caf.databaseobject.common.exception.DboException; +import io.iec.edp.caf.databaseobject.common.exception.DboExceptionCode; import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectDtRepository; import io.iec.edp.caf.rpc.api.service.RpcClient; @@ -50,7 +51,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { String content = databaseObjectDt.getContent(); DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); return commonUtil.deserialze(content); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("根据id[" + dboId + "]获取设计时DBO异常:" + e.getMessage(), e); } } @@ -61,7 +62,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { LinkedHashMap parameters = new LinkedHashMap(); parameters.put("dboId", dboId); return client.invoke(AbstractDatabaseObject.class, "io.iec.edp.caf.databaseobject.rpcapi.service.DatabaseObjectRpcService.getDtDatabaseObject", su, parameters, null); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("根据id[" + dboId + "]获取设计时DBO异常:" + e.getMessage(), e); } } @@ -76,7 +77,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { String content = databaseObjectDt.getContent(); DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); return commonUtil.deserialze(content); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("根据code[" + dboCode + "]获取设计时DBO异常:" + e.getMessage(), e); } } @@ -87,7 +88,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { LinkedHashMap parameters = new LinkedHashMap(); parameters.put("dboCode", dboCode); return client.invoke(AbstractDatabaseObject.class, "io.iec.edp.caf.databaseobject.rpcapi.service.DatabaseObjectRpcService.getDtDatabaseObjectByCode", su, parameters, null); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("根据code[" + dboCode + "]获取设计时DBO异常:" + e.getMessage(), e); } } @@ -112,7 +113,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { } } } - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("向数据库表中保存设计时DBO报错,编号为:" + databaseObject.getCode(), e); } } @@ -125,7 +126,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { LinkedHashMap parameters = new LinkedHashMap(); parameters.put("databaseObject", object); client.invoke(String.class, "io.iec.edp.caf.databaseobject.rpcapi.service.DatabaseObjectRpcService.saveDtDatabaseObject", su, parameters, null); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException("保存设计时DBO记录报错:" + e.getMessage(), e); } @@ -135,8 +136,8 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { public void deleteDtDatabaseObject(String dboId) { try { repository.deleteGspDatabaseObjectDtById(dboId); - } catch (Exception e) { - throw new RuntimeException("删除设计时DBO记录报错:" + e.getMessage(), e); + } catch (Throwable e) { + throw new DboException(DboExceptionCode.DeleteDboRecordError,"删除设计时DBO记录报错:" + e.getMessage(), null, ExceptionLevel.Warning, true); } } @@ -175,7 +176,7 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { gspDatabaseObject.setCreatedTime(java.time.LocalDateTime.now()); gspDatabaseObject.setLastModifiedTime(java.time.LocalDateTime.now()); repository.save(gspDatabaseObject); - } catch (Exception e) { + } catch (Throwable e) { throw new RuntimeException(String.format("向数据库表中新增数据库对象报错,数据库对象编号为:%1$s", databaseObject.getCode()), e); } } @@ -214,8 +215,8 @@ public class DatabaseObjectDtServiceImpl implements IDatabaseObjectDtService { public boolean isExistDatabaseObjectDt(String dboId) { try { return repository.existsById(dboId); - } catch (Exception e) { - throw new RuntimeException("根据ID判断设计时DBO是否存在报错,数据库对象ID为:" + dboId, e); + } catch (Throwable e) { + throw new DboException(DboExceptionCode.JudgeFailed,"根据ID判断设计时DBO是否存在报错,数据库对象ID为:" + dboId, null, ExceptionLevel.Warning, true); } } diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectRtService.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectRtService.java index c49ebb5..7b6062f 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectRtService.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectRtService.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager; @@ -23,6 +21,7 @@ import io.iec.edp.caf.commons.utils.SpringBeanUtils; import io.iec.edp.caf.database.Database; import io.iec.edp.caf.database.DatabaseManager; import io.iec.edp.caf.databaseobject.DboDeployManager; +import io.iec.edp.caf.databaseobject.api.configuration.FileUtils; import io.iec.edp.caf.databaseobject.api.entity.*; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; import io.iec.edp.caf.databaseobject.common.DatabaseObjectCheckUtil; @@ -30,24 +29,33 @@ import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; import io.iec.edp.caf.databaseobject.common.helper.TableNameHelper; import io.iec.edp.caf.databaseobject.common.cache.DatabaseObjectCacheManager; import io.iec.edp.caf.databaseobject.manager.DatabaseObjectServiceImpl; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseColumnMappingRepository; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectMappingRepository; import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; import io.iec.edp.caf.databaseobject.spi.ITableNameRuleManager; import io.iec.edp.caf.dimension.api.entity.DimensionEntity; import io.iec.edp.caf.i18n.api.LanguageService; import io.iec.edp.caf.rpc.api.service.RpcClient; -import io.iec.edp.caf.rpc.api.support.Type; import lombok.extern.slf4j.Slf4j; +import org.apache.tomcat.util.collections.ManagedConcurrentWeakHashMap; +import org.springframework.core.env.Environment; import java.io.IOException; import java.time.LocalDateTime; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; /** * @author liu_wei */ @Slf4j public class DatabaseObjectRtService implements IDatabaseObjectRtService { + private GspDatabaseObjectRepository repository; + private GspDatabaseObjectMappingRepository mappingRepository; + private GspDatabaseColumnMappingRepository columnMappingRepository; + private static JpaTransaction jpaTransaction; @@ -60,8 +68,10 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { private RpcClient client = SpringBeanUtils.getBean(RpcClient.class); - public DatabaseObjectRtService(GspDatabaseObjectRepository repository) { + public DatabaseObjectRtService(GspDatabaseObjectRepository repository,GspDatabaseObjectMappingRepository mappingRepository,GspDatabaseColumnMappingRepository columnMappingRepository) { this.repository = repository; + this.mappingRepository = mappingRepository; + this.columnMappingRepository = columnMappingRepository; } @@ -79,6 +89,16 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { return databaseObjectList; } + @Override + public List getGspDatabaseObjectList() { + try { + List gspDatabaseObjects = repository.findGspDatabaseObjectVoList(); + return gspDatabaseObjects; + } catch (Exception e) { + throw new RuntimeException("获取GSP数据库对象列表报错", e); + } + } + // @Override // public List getDatabaseObjectList(String su) { // Type type = new Type<>(List.class, AbstractDatabaseObject.class); @@ -94,7 +114,12 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { @Override public final AbstractDatabaseObject getDatabaseObject(String dboId) { AbstractDatabaseObject result = null; - + if(FileUtils.isMappingOpen()){ + DatabaseObjectTable table = getDatabaseObjectFromMaping(dboId); + if (table!=null ) { + return table; + } + } try { AbstractDatabaseObject databaseObject = (AbstractDatabaseObject) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(dboId); if (databaseObject != null) { @@ -114,6 +139,26 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { return result; } + @Override + public void clearDatabaseObjectMappingContent() { + DatabaseObjectCacheManager.mappingCache.clear(); + DatabaseObjectCacheManager.idmappingCache.clear(); + } + + @Override + public void clearDatabaseObjectMappingContentByIds(String ids) { + ObjectMapper mapper = new ObjectMapper(); + try { + List keys = Arrays.asList(mapper.readValue(ids, String[].class)); + for(String key:keys){ + DatabaseObjectCacheManager.mappingCache.remove(key); + DatabaseObjectCacheManager.idmappingCache.remove(key); + } + } catch (Exception e) { + throw new RuntimeException("清理一组DBO缓存出错:", e); + } + } + @Override public AbstractDatabaseObject getDatabaseObject(String dboId, String su) { try { @@ -263,7 +308,7 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { DatabaseObjectServiceImpl service = new DatabaseObjectServiceImpl(); DBInfo dbInfo = service.getDbInfo(); DatabaseObjectCommonUtil commonUtil = new DatabaseObjectCommonUtil(); - List dbTableNames = commonUtil.getDbTables(dbInfo); + List dbTableNames = commonUtil.getDbTables(dbInfo,tableNames); for (String tableName : tableNames) { result.put(tableName, false); for (String obj : dbTableNames) { @@ -381,8 +426,8 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { } try { GspDatabaseObject gspDatabaseObject = buildGspDatabaseObject(databaseObject); - gspDatabaseObject.setCreatedTime(java.time.LocalDateTime.now()); - gspDatabaseObject.setLastModifiedTime(java.time.LocalDateTime.now()); + gspDatabaseObject.setCreatedTime(LocalDateTime.now()); + gspDatabaseObject.setLastModifiedTime(LocalDateTime.now()); //gspDatabaseObject.Content = JToken.Parse(gspDatabaseObject.Content).toString(); repository.save(gspDatabaseObject); } catch (Exception e) { @@ -503,16 +548,51 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { } @Override - public final String getTableNameWithDimensionValue(String dboId, Map dimensionInfo) { + public final String getTableNameWithDimensionValue(String dboId, Map dimensionInfo) throws RuntimeException { + + //如果flag为true的话,需要走原先的逻辑,不走映射逻辑 + boolean flag = false; checkForEmptyString(dboId, "dboId"); + AbstractDatabaseObject databaseObject = null; - databaseObject = (AbstractDatabaseObject) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(dboId); - if (databaseObject == null) { - databaseObject = getDatabaseObjectFromTable(dboId); + if(FileUtils.isMappingOpen()){ + + if(DatabaseObjectCacheManager.idmappingCache.get(dboId)!=null){ + + String mappingId = DatabaseObjectCacheManager.idmappingCache.get(dboId); + + databaseObject = (AbstractDatabaseObject) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(mappingId); + + if (databaseObject == null) { + databaseObject = getDatabaseObjectFromTable(mappingId); + } + }else if(DatabaseObjectCacheManager.mappingCache.size()==0){ + getMappingTable(null); + String mappingId = DatabaseObjectCacheManager.idmappingCache.get(dboId); + if(mappingId != null){ + databaseObject = (AbstractDatabaseObject) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(mappingId); + + if (databaseObject == null) { + databaseObject = getDatabaseObjectFromTable(DatabaseObjectCacheManager.idmappingCache.get(dboId)); + } + }else{ + flag = true; + } + }else{ + flag = true; + } + }else{ + flag = true; } + if(flag){ + databaseObject = (AbstractDatabaseObject) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(dboId); + if (databaseObject == null) { + databaseObject = getDatabaseObjectFromTable(dboId); + } + } if (databaseObject == null) { throw new RuntimeException("数据库对象表中不存在为" + dboId + "的数据库对象,请确认。"); } @@ -803,9 +883,9 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { * @return */ @Override - public Map> getAllColumnCodeWithI18n(String tableId, List columnIds){ + public Map> getAllColumnCodeWithI18n(String tableId, List columnIds) { - Map> columnCodesWithI18n = new HashMap<>(); + Map> columnCodesWithI18n = new HashMap<>(); checkForEmptyString(tableId, "tableId"); checkForNullReference(columnIds, "columnIds"); try { @@ -832,11 +912,11 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { } } - private Map> getAllLanguageColumnsNameById(List columns,List multiLanguageColumns, List columnIds){ - Map> ret=new HashMap<>(); + private Map> getAllLanguageColumnsNameById(List columns, List multiLanguageColumns, List columnIds) { + Map> ret = new HashMap<>(); //获取所有语言类型: - List allLanguages=getLanguages(); + List allLanguages = getLanguages(); for (String columnId : columnIds) { if (columnId == null || columnId.length() <= 0) { @@ -850,15 +930,15 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { String columnCode = column.getCode(); if (multiLanguageColumns != null && multiLanguageColumns.size() > 0 && multiLanguageColumns.contains(columnId)) { List tempList = new ArrayList<>(); - for(String language:allLanguages){ + for (String language : allLanguages) { String columnCodeWithI18n = columnCode + language; tempList.add(columnCodeWithI18n); } - ret.put(columnCode,tempList); + ret.put(columnCode, tempList); } else { List tempList = new ArrayList<>(); tempList.add(columnCode); - ret.put(columnCode,tempList); + ret.put(columnCode, tempList); } } return ret; @@ -910,4 +990,96 @@ public class DatabaseObjectRtService implements IDatabaseObjectRtService { result.add("_PT"); return result; } + + public DatabaseObjectTable getDatabaseObjectFromMaping(String dboId) { + DatabaseObjectTable table = null; + try { + Map mappingMap = DatabaseObjectCacheManager.mappingCache; + //TODO 统一入口操作缓存 + if(mappingMap.size()==0){ + Map map = getMappingTable(null); + if(mappingMap.get(dboId)!=null){ + table = (DatabaseObjectTable) mappingMap.get(dboId); + } + }else if(mappingMap.get(dboId)!=null){ + table = (DatabaseObjectTable) mappingMap.get(dboId); + }else{ +// List dboids =new ArrayList<>(); +// dboids.add(dboId); +// Map map = getMappingTable(dboids); +// table = (DatabaseObjectTable) map.get(dboId); + } + } catch (Exception ex) { + throw new RuntimeException("根据code或dboId获取映射对象出错{}", ex); + } + return table; + } + + public Map getMappingTable(List dboIds){ + Map tableMap =new ConcurrentHashMap<>(); + List mappingList = new ArrayList<>(); + if(dboIds==null || dboIds.size()==0){ + mappingList = this.mappingRepository.findAll(); + }else { + mappingList = this.mappingRepository.findAllByDboIdIn(dboIds); + } + if(mappingList.size()>0){ + for(GspDatabaseObjectMapping mapping:mappingList){ + if (mapping != null) { + String dboIdMapping = mapping.getDboIdMapping() == null ? null : mapping.getDboIdMapping(); + if (dboIdMapping != null) { + DatabaseObjectCacheManager.idmappingCache.put(mapping.getDboId(),mapping.getDboIdMapping()); + String key = mapping.getDboId(); + DatabaseObjectTable tableCache = (DatabaseObjectTable) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(mapping.getDboId()); + DatabaseObjectTable table = null; + if(tableCache!=null){ + table=tableCache.clone(); + } + if (table == null) { + table = (DatabaseObjectTable) getDatabaseObjectFromTable(mapping.getDboId()); + } + DatabaseObjectTable tableMappingCache = (DatabaseObjectTable) DatabaseObjectCacheManager.getInstance().getDatabaseObjectContent(dboIdMapping); + DatabaseObjectTable tableMapping = null; + if(tableMappingCache!=null){ + tableMapping=tableMappingCache.clone(); + } + if (tableMapping == null) { + tableMapping = (DatabaseObjectTable) getDatabaseObjectFromTable(dboIdMapping); + } + List columnMappings = (List) this.columnMappingRepository.findAllByDboId(mapping.getDboId()); + if (columnMappings != null && columnMappings.size() > 0) { + List columns = table.getColumns(); + List mappingColumns = new ArrayList<>(); + Map map = new HashMap<>(); + for(GspDatabaseObjectColumnMapping columnMapping:columnMappings){ + map.put(columnMapping.getColumnId(),columnMapping); + } + for (DatabaseObjectColumn column : columns) { + GspDatabaseObjectColumnMapping value = map.get(column.getId()); + if (value!=null) { + DatabaseObjectColumn mappingColumn = tableMapping.getColumnById(value.getColumnIdMapping()); + mappingColumn.setId(column.getId()); + mappingColumns.add(mappingColumn); + }else{ + DatabaseObjectColumn column1 = table.getColumnById(column.getId()); + mappingColumns.add(column1); + } + } + table.setColumns(mappingColumns); + table.setCode(tableMapping.getCode()); + table.setName(tableMapping.getName()); + tableMap.put(key,table); + DatabaseObjectCacheManager.mappingCache.put(key,table); + }else{ + table.setName(tableMapping.getName()); + table.setCode(tableMapping.getCode()); + tableMap.put(key,table); + DatabaseObjectCacheManager.mappingCache.put(key,table); + } + } + } + } + } + return tableMap; + } } diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectTempTableServiceImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectTempTableServiceImpl.java index bf907b2..45d9ed0 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectTempTableServiceImpl.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DatabaseObjectTempTableServiceImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager; @@ -23,14 +21,17 @@ import io.iec.edp.caf.databaseobject.DboDeployManager; import io.iec.edp.caf.databaseobject.api.entity.*; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectTempTableService; +import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; import io.iec.edp.caf.databaseobject.manager.DatabaseObjectServiceImpl; import lombok.extern.slf4j.Slf4j; -import javax.persistence.EntityManager; +import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.SQLSyntaxErrorException; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; /** @@ -44,6 +45,7 @@ public class DatabaseObjectTempTableServiceImpl implements IDatabaseObjectTempTa private static Map> transactionTempTableSqlCache = new ConcurrentHashMap<>(); private IDatabaseObjectRtService databaseObjectRtService = SpringBeanUtils.getBean(IDatabaseObjectRtService.class); + @Override public TempTableContext createFixedTable(Database database, ScopeType type, String dboCode) { //固定列临时表SQL不变,进行缓存,可以提升性能 @@ -56,7 +58,7 @@ public class DatabaseObjectTempTableServiceImpl implements IDatabaseObjectTempTa } return execute(database, dboCode, type, sqlList); } catch (Exception e) { - throw new RuntimeException("根据dboId创建临时表出错:" + e); + throw new RuntimeException("根据dboId创建临时表出错:{}",e); } } @@ -75,28 +77,76 @@ public class DatabaseObjectTempTableServiceImpl implements IDatabaseObjectTempTa } } - private TempTableContext execute(Database database, String dboCode, ScopeType type, List sqlList) throws SQLException { - EntityManager entityManager = SpringBeanUtils.getBean(EntityManager.class); + public TempTableContext execute(Database database, String dboCode, ScopeType type, List sqlList) throws SQLException { String sessionId = CAFContext.current.getSessionId(); + String suffix = sessionId.substring(sessionId.length() - 10); DatabaseObjectServiceImpl service = new DatabaseObjectServiceImpl(); DBInfo dbInfo = service.getDbInfo(); - String tempTableCode = dboCode + sessionId.substring(sessionId.length() - 10); + String tempTableCode = null; + if (DbType.Oracle.equals(dbInfo.getDbType()) || DbType.DB2.equals(dbInfo.getDbType()) || DbType.DM.equals(dbInfo.getDbType()) || DbType.Kingbase.equals(dbInfo.getDbType())) { + tempTableCode = dboCode + "_" +type.toString(); + }else{ + tempTableCode = dboCode + suffix; + } + String tempTableName=tempTableCode; //设置成真正表名 if (dbInfo.getDbType() == DbType.SQLServer) { tempTableCode = "#" + tempTableCode; + tempTableName = "#" + tempTableCode; + } + String querySql=DatabaseObjectCommonUtil.tempTableIsExist(dbInfo,tempTableName); + if(!"".equals(querySql)){ + ResultSet resultSet=database.query(querySql); + if(dbInfo.getDbType() == DbType.SQLServer){ + if(resultSet.next()){ + if(resultSet.getString("id")!=null && !"".equals(resultSet.getString("id"))){ + TempTableContext context = new TempTableContext(); + context.setTableName(tempTableName); + return context; + } + } + }else{ + if(resultSet.next()){ + TempTableContext context = new TempTableContext(); + context.setTableName(tempTableName); + return context; + } + } } for (String sql : sqlList) { - sql = sql.replaceAll("(?i)" + dboCode, tempTableCode); + if(dbInfo.getDbType() == DbType.SQLServer){ + if(sql.contains("#")){ + String code ="#"+dboCode; + sql = sql.replaceAll("(?i)" + code, tempTableName); + }else{ + sql = sql.replaceAll("(?i)" + dboCode, tempTableName); + String index_name = sql.split(" index ")[1].split(" ")[0]; + sql = sql.replaceAll("(?i)" + index_name,index_name+ suffix); + } + }else{ + if(sql.toLowerCase().contains(" index ")){ + sql = sql.replaceAll("(?i)" + dboCode, tempTableName); + String index_name = sql.split(" index ")[1].split(" ")[0]; + sql = sql.replaceAll("(?i)" + index_name,index_name+suffix); + }else{ + sql = sql.replaceAll("(?i)" + dboCode, tempTableName); + } + } log.debug("执行的临时表创建SQL为:" + sql); - if (ScopeType.Session.equals(type)) { - database.execute(sql); - } else { - //事务级使用EntityManager创建 - entityManager.createNativeQuery(sql).executeUpdate(); + try{ + if (ScopeType.Session.equals(type)) { + database.execute(sql); + } else { + database.execute(sql); + } + }catch (Exception e){ + if(!e.getMessage().toLowerCase().contains("duplicate key name")) { + throw e; + } } } TempTableContext context = new TempTableContext(); - context.setTableName(tempTableCode); + context.setTableName(tempTableName); return context; } @@ -138,6 +188,9 @@ public class DatabaseObjectTempTableServiceImpl implements IDatabaseObjectTempTa List sqlList = getTemplateSql(dboCode); List sqlListNew = new ArrayList<>(); for (String sql : sqlList) { + if(sql.contains("#")){ + sqlListNew=sqlList; + } if (sql.contains("ON COMMIT PRESERVE ROWS")) { sqlListNew.add(sql.replaceAll("(?i)ON COMMIT PRESERVE ROWS", "ON COMMIT DELETE ROWS")); } @@ -156,6 +209,9 @@ public class DatabaseObjectTempTableServiceImpl implements IDatabaseObjectTempTa List sqlList = getTemplateSql(dboCode); List sqlListNew = new ArrayList<>(); for (String sql : sqlList) { + if(sql.contains("#")){ + sqlListNew=sqlList; + } if (sql.contains("ON COMMIT PRESERVE ROWS")) { sqlListNew.add(sql.replaceAll("(?i)ON COMMIT PRESERVE ROWS", "ON COMMIT DELETE ROWS")); } diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DboEventHandle.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DboEventHandle.java index 6646f6a..f761701 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DboEventHandle.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DboEventHandle.java @@ -1,19 +1,3 @@ -/* - * Copyright (c) 2020 - present, Inspur Genersoft Co., 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 io.iec.edp.caf.databaseobject.rtmanager; import io.iec.edp.caf.commons.utils.SpringBeanUtils; diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java index eb66433..7054d48 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java @@ -1,30 +1,35 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager.config; -import io.iec.edp.caf.commons.utils.SpringBeanUtils; + + + + +import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCollectSpi; +import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCopySpi; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDeployService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectTempTableService; import io.iec.edp.caf.databaseobject.rpcapi.service.DatabaseObjectRpcService; import io.iec.edp.caf.databaseobject.rtmanager.*; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseColumnMappingRepository; import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectDtRepository; +import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectMappingRepository; import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; import io.iec.edp.caf.databaseobject.rtmanager.rpc.DatabaseObjectRpcServiceImpl; import io.iec.edp.caf.rest.RESTEndpoint; @@ -42,9 +47,9 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; public class DatabaseObjectRtServiceConfiguration { @Bean public IDatabaseObjectRtService databaseObjectRtService( - GspDatabaseObjectRepository repo - ) { - return new DatabaseObjectRtService(repo); + GspDatabaseObjectRepository repository, GspDatabaseObjectMappingRepository mappingRepository, GspDatabaseColumnMappingRepository columnMappingRepository + ) { + return new DatabaseObjectRtService(repository,mappingRepository,columnMappingRepository); } @Bean @@ -83,4 +88,13 @@ public class DatabaseObjectRtServiceConfiguration { public IDatabaseObjectTempTableService databaseObjectTempTableService(){ return new DatabaseObjectTempTableServiceImpl(); } + @Bean + public ConfigDataCollectSpi dboConfigDataCollect(){ + return new DBOConfigDataCollectImpl(); + } + + @Bean + public ConfigDataCopySpi dboConfigDataCopy(){ + return new DBOConfigDataCopyImpl(); + } } diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseColumnMappingRepository.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseColumnMappingRepository.java new file mode 100644 index 0000000..52e4abe --- /dev/null +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseColumnMappingRepository.java @@ -0,0 +1,10 @@ +package io.iec.edp.caf.databaseobject.rtmanager.repository; + +import io.iec.edp.caf.data.orm.DataRepository; +import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObjectColumnMapping; + +import java.util.List; + +public interface GspDatabaseColumnMappingRepository extends DataRepository { + List findAllByDboId(String dboId); +} diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectDtRepository.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectDtRepository.java index 191bda5..f1c3974 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectDtRepository.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectDtRepository.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager.repository; diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectMappingRepository.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectMappingRepository.java new file mode 100644 index 0000000..b333c6c --- /dev/null +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectMappingRepository.java @@ -0,0 +1,11 @@ +package io.iec.edp.caf.databaseobject.rtmanager.repository; + +import io.iec.edp.caf.data.orm.DataRepository; +import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObjectMapping; + +import java.util.List; + +public interface GspDatabaseObjectMappingRepository extends DataRepository { + GspDatabaseObjectMapping findByDboId(String var1); + List findAllByDboIdIn(List ids); +} diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectRepository.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectRepository.java index 17e9003..fb79800 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectRepository.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/repository/GspDatabaseObjectRepository.java @@ -1,26 +1,25 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager.repository; import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject; import io.iec.edp.caf.data.orm.DataRepository; +import org.springframework.data.jpa.repository.Query; import java.util.ArrayList; -import java.util.Optional; +import java.util.List; /** * @author zhaoleitr @@ -39,4 +38,7 @@ public interface GspDatabaseObjectRepository extends DataRepository findAllByType(int type); ArrayList findAllByRuleCode(String ruleCode); + + @Query(value = "select new io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject(g.id,g.code,g.name,g.type) from GspDatabaseObject g") + List findGspDatabaseObjectVoList(); } diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DatabaseObjectRpcServiceImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DatabaseObjectRpcServiceImpl.java index 5565dfa..1fe2202 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DatabaseObjectRpcServiceImpl.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DatabaseObjectRpcServiceImpl.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager.rpc; diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DboSerializer.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DboSerializer.java index 59b2445..a6410dd 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DboSerializer.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/rpc/DboSerializer.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rtmanager.rpc; diff --git a/caf-database-object-rttest/pom.xml b/caf-database-object-rttest/pom.xml index 174564f..045efd2 100644 --- a/caf-database-object-rttest/pom.xml +++ b/caf-database-object-rttest/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 @@ -36,7 +34,7 @@ io.iec.edp caf-database-object-api - 0.2.10 + 0.3.0 provided @@ -51,6 +49,18 @@ 1.0.0-rc.1 provided + + io.iec.edp + caf-database-object-common + 0.3.0 + compile + + + io.iec.edp + caf-database-object-manager + 0.3.0 + compile + diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java index f342434..cde4b87 100644 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java +++ b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java @@ -1,32 +1,34 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rttest; +import com.alibaba.fastjson.JSONObject; import io.iec.edp.caf.boot.context.CAFContext; import io.iec.edp.caf.commons.utils.SpringBeanUtils; import io.iec.edp.caf.database.Database; import io.iec.edp.caf.database.DatabaseManager; import io.iec.edp.caf.databaseobject.api.entity.AbstractDatabaseObject; +//import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObjectVo; import io.iec.edp.caf.databaseobject.api.entity.ScopeType; import io.iec.edp.caf.databaseobject.api.entity.TempTableContext; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDeployService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectTempTableService; +import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; +import io.iec.edp.caf.databaseobject.manager.persistent.RepositoryFactory; import io.iec.edp.caf.databaseobject.rttest.api.IDatabaseObjectRtTestService; import lombok.extern.slf4j.Slf4j; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import javax.swing.*; import javax.ws.rs.core.Response; +import java.io.IOException; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.util.ArrayList; @@ -52,6 +55,7 @@ public class DatabaseObjectRtTestServiceImpl implements IDatabaseObjectRtTestSer private IDatabaseObjectDeployService databaseObjectDeployService = SpringBeanUtils.getBean(IDatabaseObjectDeployService.class); private IDatabaseObjectDtService databaseObjectDtService = SpringBeanUtils.getBean(IDatabaseObjectDtService.class); private IDatabaseObjectTempTableService databaseObjectTempTableService= SpringBeanUtils.getBean(IDatabaseObjectTempTableService.class); + @Override public Response getDtDatabaseById(String id) { try { @@ -85,6 +89,12 @@ public class DatabaseObjectRtTestServiceImpl implements IDatabaseObjectRtTestSer } } + @Override + public String getDatabaseObjectName(String id) { + String name=databaseObjectRtService.getTableNameWithDimensionValue(id,null); + return name; + } + @Override public Response getDatabaseObjectByCode(String code, String su) { try { @@ -180,14 +190,21 @@ public class DatabaseObjectRtTestServiceImpl implements IDatabaseObjectRtTestSer } } + @Override - public Response deployTempTableDatabaseObjects(String dboid) { + public Response deployTempTableDatabaseObjects(String dboid, String type) { try{ DatabaseManager databaseManager = DatabaseManager.getInstance(); databaseManager.begin(); Database database = databaseManager.getDatabase(); TempTableContext tempTableContext=null; - tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Session, dboid); + if("session".equals(type)){ + tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Session, dboid); + }else if("transaction".equals(type)){ + tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Transactional, dboid); + }else{ + tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Session, dboid); + } String sql1="insert into "+tempTableContext.getTableName()+" values('test0','test0')"; String sql2="select * from "+tempTableContext.getTableName(); System.out.println(database.execute(sql1)); @@ -219,4 +236,28 @@ public class DatabaseObjectRtTestServiceImpl implements IDatabaseObjectRtTestSer List result = em.createNativeQuery(sql2).getResultList(); return null; } + + @Override + public AbstractDatabaseObject getDatabaseObjectByCode(String code) { + AbstractDatabaseObject abstractDatabaseObject=databaseObjectRtService.getDatabaseObjectByCode(code); + return abstractDatabaseObject; + } + + @Override + public AbstractDatabaseObject getDatabaseObjectByDboId(String dboid) { + AbstractDatabaseObject abstractDatabaseObject=databaseObjectRtService.getDatabaseObject(dboid); + return abstractDatabaseObject; + } + + @Override + public void deployDatabaseObjectByPath(String path) throws IOException { + String content=RepositoryFactory.getInstance().getDatabaseObjectManagerRepository().read(path); + DatabaseObjectCommonUtil commonUtil=new DatabaseObjectCommonUtil(); + AbstractDatabaseObject abstractDatabaseObject=commonUtil.deserialze(content); + } + +// @Override +// public List getDatabaseObjects() { +// return databaseObjectRtService.getGspDatabaseObjectList(); +// } } diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java index 3520445..f5e74d9 100644 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java +++ b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java @@ -1,24 +1,28 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rttest.api; +import com.alibaba.fastjson.JSONObject; +import io.iec.edp.caf.databaseobject.api.entity.AbstractDatabaseObject; +import org.springframework.web.bind.annotation.RequestBody; + import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.List; /** * @author liu_wei @@ -30,11 +34,11 @@ public interface IDatabaseObjectRtTestService { @GET @Path("dt/{id}") - Response getDtDatabaseById(@PathParam("id")String id); + Response getDtDatabaseById(@PathParam("id") String id); @GET @Path("dtsu/id/{id}/{su}") - Response getSuDtDatabaseById(@PathParam("id")String id, @PathParam("su")String su); + Response getSuDtDatabaseById(@PathParam("id") String id, @PathParam("su") String su); /** * 获取运行时dbo @@ -43,7 +47,16 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("rtsu/id/{id}/{su}") - Response getDatabaseObject(@PathParam("id")String id, @PathParam("su")String su); + Response getDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); + + /** + * 获取运行时dbo名称 + * + * @return 数据库对象 + */ + @POST + @Path("rtsu/id/{id}") + String getDatabaseObjectName(@PathParam("id") String id); /** * 根据数据库对象编号获取数据库对象 @@ -52,7 +65,7 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("rtsu/code/{code}/{su}") - Response getDatabaseObjectByCode(@PathParam("code")String code, @PathParam("su")String su); + Response getDatabaseObjectByCode(@PathParam("code") String code, @PathParam("su") String su); /** * 获取默认DBO实体列表 @@ -71,7 +84,7 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("dtsu/code/{code}/{su}") - Response getDtDatabaseObjectByCode(@PathParam("code")String code, @PathParam("su")String su); + Response getDtDatabaseObjectByCode(@PathParam("code") String code, @PathParam("su") String su); /** * 保存 @@ -80,7 +93,7 @@ public interface IDatabaseObjectRtTestService { */ @POST @Path("dtsu/save/{id}/{su}") - Response saveDtDatabaseObject(@PathParam("id")String id, @PathParam("su")String su); + Response saveDtDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); /** * 删除 @@ -89,7 +102,7 @@ public interface IDatabaseObjectRtTestService { */ @DELETE @Path("dtsu/delete/{id}/{su}") - Response deleteDtDatabaseObject(@PathParam("id")String id, @PathParam("su")String su); + Response deleteDtDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); /** * 根据Id判断设计时DBO是否存在 @@ -98,7 +111,7 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("dtsu/exist/{id}/{su}") - Response isExistDatabaseObjectDt(@PathParam("id")String id, @PathParam("su")String su); + Response isExistDatabaseObjectDt(@PathParam("id") String id, @PathParam("su") String su); /** * 部署单个DBO @@ -107,7 +120,7 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("dtsu/sigle/{id}/{su}") - Response deployDatabaseObject(@PathParam("id")String id, @PathParam("su")String su); + Response deployDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); /** * 部署多个DBO @@ -116,7 +129,7 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("dtsu/multiple/{id}/{su}") - Response deployDatabaseObjects(@PathParam("id")String id, @PathParam("su")String su); + Response deployDatabaseObjects(@PathParam("id") String id, @PathParam("su") String su); /** @@ -125,8 +138,8 @@ public interface IDatabaseObjectRtTestService { * @return 部署结果 */ @GET - @Path("dtsu/multiple/{dboid}") - Response deployTempTableDatabaseObjects(@PathParam("dboid")String dboid); + @Path("dtsu/multiple/temp/{dboid}/{type}") + Response deployTempTableDatabaseObjects(@PathParam("dboid") String dboid, @PathParam("type") String type); /** @@ -136,6 +149,41 @@ public interface IDatabaseObjectRtTestService { */ @GET @Path("dtsu/Transaction/{dboid}") - Response deployTransactionTempTableDatabaseObjects(@PathParam("dboid")String dboid); + Response deployTransactionTempTableDatabaseObjects(@PathParam("dboid") String dboid); + + /** + * 根据code查找对应关系 + * + * @return 部署结果 + */ + @GET + @Path("dtsu/mapping/code/{code}") + AbstractDatabaseObject getDatabaseObjectByCode(@PathParam("code") String code); + /** + * 根据dboId查找对应关系 + * + * @return 部署结果 + */ + @GET + @Path("dtsu/mapping/dboid/{dboid}") + AbstractDatabaseObject getDatabaseObjectByDboId(@PathParam("dboid") String dboid); + + /** + * 创建dbo + * + * @return 部署结果 + */ + @GET + @Path("dbo/create/{path}") + void deployDatabaseObjectByPath(@PathParam("path") String path) throws IOException; + + /** + * 查找dbo列表 + * + * @return 部署结果 + */ +// @GET +// @Path("find/all/dbos/") +// List getDatabaseObjects(); } diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java index 3f0c0c6..ab2ec25 100644 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java +++ b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.rttest.config; diff --git a/caf-database-object-spi/pom.xml b/caf-database-object-spi/pom.xml new file mode 100644 index 0000000..7a86cb5 --- /dev/null +++ b/caf-database-object-spi/pom.xml @@ -0,0 +1,36 @@ + + + + + + caf-database-object + io.iec.edp + 0.3.0 + + 4.0.0 + jar + caf-database-object-spi + + + io.iec.edp + caf-database-object-api + ${project.version} + + + + + diff --git a/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java b/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java new file mode 100644 index 0000000..441eabb --- /dev/null +++ b/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java @@ -0,0 +1,31 @@ +/* + * Copyright © OpenAtom Foundation. + * 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 io.iec.edp.caf.databaseobject.spi; + +import io.iec.edp.caf.databaseobject.api.entity.DBOTableNameRule; + +import java.util.List; +import java.util.Map; + +/** + * @author liu_wei + */ +public interface ITableNameRuleManager { + + String getTableName(String tableName, DBOTableNameRule rule, Map dimensionInfo); + + + List getTableNames(String tableName, DBOTableNameRule rule, Map> dimensioinInfo); +} diff --git a/caf-name-rule-extend/pom.xml b/caf-name-rule-extend/pom.xml index 695559e..74b1fd2 100644 --- a/caf-name-rule-extend/pom.xml +++ b/caf-name-rule-extend/pom.xml @@ -1,18 +1,16 @@ caf-database-object io.iec.edp - 0.2.10 + 0.3.0 4.0.0 jar diff --git a/caf-name-rule-extend/src/main/java/io/iec/edp/caf/databaseobject/tablenameruleextend/DboTableNameExtendManager.java b/caf-name-rule-extend/src/main/java/io/iec/edp/caf/databaseobject/tablenameruleextend/DboTableNameExtendManager.java index d8defa8..a74cb1e 100644 --- a/caf-name-rule-extend/src/main/java/io/iec/edp/caf/databaseobject/tablenameruleextend/DboTableNameExtendManager.java +++ b/caf-name-rule-extend/src/main/java/io/iec/edp/caf/databaseobject/tablenameruleextend/DboTableNameExtendManager.java @@ -1,17 +1,15 @@ /* - * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd. - * + * Copyright © OpenAtom Foundation. * 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 - * + * 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. + * 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 io.iec.edp.caf.databaseobject.tablenameruleextend; @@ -118,10 +116,9 @@ public class DboTableNameExtendManager implements ITableNameRuleManager { return dboCode + new SimpleDateFormat("yyMM").format(date); } } - if(dimensionValue != null && !dimensionValue.containsKey("YYMM")) - { - if (("YYMM").equalsIgnoreCase(dboTableNameRule.getCode())) { - Date date = new Date(); + if(dimensionValue != null && !dimensionValue.containsKey("YYMM")){ + if(("YYMM").equalsIgnoreCase(dboTableNameRule.getCode())){ + Date date =new Date(); return dboCode + new SimpleDateFormat("yyMM").format(date); } } @@ -150,7 +147,7 @@ public class DboTableNameExtendManager implements ITableNameRuleManager { value = String.valueOf(java.time.LocalDateTime.now().getYear()); } tableName = tableName + value; - } catch (java.lang.Exception e) { + } catch (Exception e) { //吞掉异常;if判断没起作用,暂不需要。 //if (strategy.DimensionEntity.Code == "FIYear") tableName += java.time.LocalDateTime.now().getYear(); diff --git a/pom.xml b/pom.xml index 9a21935..7b97ad0 100644 --- a/pom.xml +++ b/pom.xml @@ -1,18 +1,16 @@ caf-database-object-common caf-database-object-rtmanager caf-name-rule-extend + caf-database-object-spi caf-database-object-manager caf-database-object-deploy caf-database-object-deploy-spi @@ -37,6 +36,7 @@ caf-database-object-deploy-mysqlgenerator caf-database-object-deploy-oscargenerator caf-database-object-deploy-db2generator + caf-database-object-deploy-gaussgenerator caf-database-object-rpcapi caf-database-object-rttest @@ -49,7 +49,7 @@ caf-database-object pom - 0.2.10 + 0.3.0 diff --git a/style/ubml_checkstyle.xml b/style/ubml_checkstyle.xml index 70d6f58..dbcc93e 100644 --- a/style/ubml_checkstyle.xml +++ b/style/ubml_checkstyle.xml @@ -1,18 +1,16 @@ Date: Mon, 10 Jul 2023 15:01:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=BA=E6=9C=80=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- caf-database-object-rttest/pom.xml | 67 ----- .../DatabaseObjectRtTestServiceImpl.java | 263 ------------------ .../api/IDatabaseObjectRtTestService.java | 189 ------------- ...abaseObjectRtTestServiceConfiguration.java | 45 --- .../main/resources/META-INF/spring.factories | 1 - caf-database-object-spi/pom.xml | 36 --- .../spi/ITableNameRuleManager.java | 31 --- pom.xml | 2 - 8 files changed, 634 deletions(-) delete mode 100644 caf-database-object-rttest/pom.xml delete mode 100644 caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java delete mode 100644 caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java delete mode 100644 caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java delete mode 100644 caf-database-object-rttest/src/main/resources/META-INF/spring.factories delete mode 100644 caf-database-object-spi/pom.xml delete mode 100644 caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java diff --git a/caf-database-object-rttest/pom.xml b/caf-database-object-rttest/pom.xml deleted file mode 100644 index 045efd2..0000000 --- a/caf-database-object-rttest/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - caf-database-object - io.iec.edp - 0.3.0 - - 4.0.0 - - caf-database-object-rttest - - - io.iec.edp - caf-rest-api - 1.0.0-rc.1 - provided - - - io.iec.edp - caf-database-object-api - 0.3.0 - provided - - - io.iec.edp - caf-data-jdbc - 1.0.0-rc.1 - provided - - - io.iec.edp - caf-context-api - 1.0.0-rc.1 - provided - - - io.iec.edp - caf-database-object-common - 0.3.0 - compile - - - io.iec.edp - caf-database-object-manager - 0.3.0 - compile - - - - - diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java deleted file mode 100644 index cde4b87..0000000 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/DatabaseObjectRtTestServiceImpl.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright © OpenAtom Foundation. - * 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 io.iec.edp.caf.databaseobject.rttest; - -import com.alibaba.fastjson.JSONObject; -import io.iec.edp.caf.boot.context.CAFContext; -import io.iec.edp.caf.commons.utils.SpringBeanUtils; -import io.iec.edp.caf.database.Database; -import io.iec.edp.caf.database.DatabaseManager; -import io.iec.edp.caf.databaseobject.api.entity.AbstractDatabaseObject; -//import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObjectVo; -import io.iec.edp.caf.databaseobject.api.entity.ScopeType; -import io.iec.edp.caf.databaseobject.api.entity.TempTableContext; -import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDeployService; -import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDtService; -import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; -import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectTempTableService; -import io.iec.edp.caf.databaseobject.common.DatabaseObjectCommonUtil; -import io.iec.edp.caf.databaseobject.manager.persistent.RepositoryFactory; -import io.iec.edp.caf.databaseobject.rttest.api.IDatabaseObjectRtTestService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.transaction.annotation.Transactional; - -import javax.persistence.EntityManager; -import javax.swing.*; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @author : liu_wei - * @date : 2022-02-15 11:37 - **/ -@Slf4j -public class DatabaseObjectRtTestServiceImpl implements IDatabaseObjectRtTestService { - - private IDatabaseObjectRtService databaseObjectRtService = SpringBeanUtils.getBean(IDatabaseObjectRtService.class); - private IDatabaseObjectDeployService databaseObjectDeployService = SpringBeanUtils.getBean(IDatabaseObjectDeployService.class); - private IDatabaseObjectDtService databaseObjectDtService = SpringBeanUtils.getBean(IDatabaseObjectDtService.class); - private IDatabaseObjectTempTableService databaseObjectTempTableService= SpringBeanUtils.getBean(IDatabaseObjectTempTableService.class); - - @Override - public Response getDtDatabaseById(String id) { - try { - Object result = databaseObjectDtService.getDtDatabaseObject(id); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response getSuDtDatabaseById(String id, String su) { - try { - Object result = databaseObjectDtService.getDtDatabaseObject(id, su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response getDatabaseObject(String id, String su) { - try { - Object result = databaseObjectRtService.getDatabaseObject(id, su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public String getDatabaseObjectName(String id) { - String name=databaseObjectRtService.getTableNameWithDimensionValue(id,null); - return name; - } - - @Override - public Response getDatabaseObjectByCode(String code, String su) { - try { - Object result = databaseObjectRtService.getDatabaseObjectByCode(code, su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - -// @Override -// public Response getDatabaseObjectList(String su) { -// try { -// Object result = databaseObjectRtService.getDatabaseObjectList(su); -// return Response.ok().entity(result).build(); -// }catch(Exception ex){ -// log.error(ex.getMessage(), ex); -// return Response.serverError().entity(ex.getMessage()).build(); -// } -// } - - @Override - public Response getDtDatabaseObjectByCode(String code, String su) { - try { - Object result = databaseObjectDtService.getDtDatabaseObjectByCode(code, su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response saveDtDatabaseObject(String id, String su) { - try { - databaseObjectDtService.saveDtDatabaseObject(databaseObjectRtService.getDatabaseObject(id), su); - return Response.ok().build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response deleteDtDatabaseObject(String id, String su) { - try { - databaseObjectDtService.deleteDtDatabaseObject(id, su); - return Response.ok().build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response isExistDatabaseObjectDt(String id, String su) { - try { - Object result = databaseObjectDtService.isExistDatabaseObjectDt(id, su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response deployDatabaseObject(String id, String su) { - try { - Map dimensionInfo = new HashMap<>(); - dimensionInfo.put("FIYear", "2022"); - databaseObjectDeployService.deployDatabaseObject(databaseObjectRtService.getDatabaseObject(id, su), dimensionInfo, su); - return Response.ok().build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - @Override - public Response deployDatabaseObjects(String id, String su) { - try { - Map dimensionInfo = new HashMap<>(); - dimensionInfo.put("FIYear", "2022"); - AbstractDatabaseObject object = databaseObjectRtService.getDatabaseObject(id, su); - List databaseObjects = new ArrayList<>(); - databaseObjects.add(object); - Object result = databaseObjectDeployService.deployDatabaseObjects(databaseObjects,dimensionInfo , su); - return Response.ok().entity(result).build(); - }catch(Exception ex){ - log.error(ex.getMessage(), ex); - return Response.serverError().entity(ex.getMessage()).build(); - } - } - - - @Override - public Response deployTempTableDatabaseObjects(String dboid, String type) { - try{ - DatabaseManager databaseManager = DatabaseManager.getInstance(); - databaseManager.begin(); - Database database = databaseManager.getDatabase(); - TempTableContext tempTableContext=null; - if("session".equals(type)){ - tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Session, dboid); - }else if("transaction".equals(type)){ - tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Transactional, dboid); - }else{ - tempTableContext = databaseObjectTempTableService.createFixedTable(database, ScopeType.Session, dboid); - } - String sql1="insert into "+tempTableContext.getTableName()+" values('test0','test0')"; - String sql2="select * from "+tempTableContext.getTableName(); - System.out.println(database.execute(sql1)); - ResultSet resultSet=database.query(sql2); - ResultSetMetaData rsmd = resultSet.getMetaData(); - int numberOfColumns = rsmd.getColumnCount(); - resultSet.next(); - for(int i=0;i getDatabaseObjects() { -// return databaseObjectRtService.getGspDatabaseObjectList(); -// } -} diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java deleted file mode 100644 index f5e74d9..0000000 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/api/IDatabaseObjectRtTestService.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright © OpenAtom Foundation. - * 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 io.iec.edp.caf.databaseobject.rttest.api; - -import com.alibaba.fastjson.JSONObject; -import io.iec.edp.caf.databaseobject.api.entity.AbstractDatabaseObject; -import org.springframework.web.bind.annotation.RequestBody; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.util.List; - -/** - * @author liu_wei - */ -@Path("/") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -public interface IDatabaseObjectRtTestService { - - @GET - @Path("dt/{id}") - Response getDtDatabaseById(@PathParam("id") String id); - - @GET - @Path("dtsu/id/{id}/{su}") - Response getSuDtDatabaseById(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 获取运行时dbo - * - * @return 数据库对象 - */ - @GET - @Path("rtsu/id/{id}/{su}") - Response getDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 获取运行时dbo名称 - * - * @return 数据库对象 - */ - @POST - @Path("rtsu/id/{id}") - String getDatabaseObjectName(@PathParam("id") String id); - - /** - * 根据数据库对象编号获取数据库对象 - * - * @return 数据库对象列表 - */ - @GET - @Path("rtsu/code/{code}/{su}") - Response getDatabaseObjectByCode(@PathParam("code") String code, @PathParam("su") String su); - - /** - * 获取默认DBO实体列表 - * - * @return DBO实体列表 - */ -// @GET -// @Path("rtsu/all/{su}") -// Response getDatabaseObjectList(@PathParam("su")String su); - - - /** - * 获取设计时DBO - * - * @return DBO - */ - @GET - @Path("dtsu/code/{code}/{su}") - Response getDtDatabaseObjectByCode(@PathParam("code") String code, @PathParam("su") String su); - - /** - * 保存 - * - * @return RPC结果 - */ - @POST - @Path("dtsu/save/{id}/{su}") - Response saveDtDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 删除 - * - * @return RPC结果 - */ - @DELETE - @Path("dtsu/delete/{id}/{su}") - Response deleteDtDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 根据Id判断设计时DBO是否存在 - * - * @return 结果 - */ - @GET - @Path("dtsu/exist/{id}/{su}") - Response isExistDatabaseObjectDt(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 部署单个DBO - * - * @return RPC结果 - */ - @GET - @Path("dtsu/sigle/{id}/{su}") - Response deployDatabaseObject(@PathParam("id") String id, @PathParam("su") String su); - - /** - * 部署多个DBO - * - * @return 部署结果 - */ - @GET - @Path("dtsu/multiple/{id}/{su}") - Response deployDatabaseObjects(@PathParam("id") String id, @PathParam("su") String su); - - - /** - * 部署临时表DBO - * - * @return 部署结果 - */ - @GET - @Path("dtsu/multiple/temp/{dboid}/{type}") - Response deployTempTableDatabaseObjects(@PathParam("dboid") String dboid, @PathParam("type") String type); - - - /** - * 部署事务临时表DBO - * - * @return 部署结果 - */ - @GET - @Path("dtsu/Transaction/{dboid}") - Response deployTransactionTempTableDatabaseObjects(@PathParam("dboid") String dboid); - - /** - * 根据code查找对应关系 - * - * @return 部署结果 - */ - @GET - @Path("dtsu/mapping/code/{code}") - AbstractDatabaseObject getDatabaseObjectByCode(@PathParam("code") String code); - - /** - * 根据dboId查找对应关系 - * - * @return 部署结果 - */ - @GET - @Path("dtsu/mapping/dboid/{dboid}") - AbstractDatabaseObject getDatabaseObjectByDboId(@PathParam("dboid") String dboid); - - /** - * 创建dbo - * - * @return 部署结果 - */ - @GET - @Path("dbo/create/{path}") - void deployDatabaseObjectByPath(@PathParam("path") String path) throws IOException; - - /** - * 查找dbo列表 - * - * @return 部署结果 - */ -// @GET -// @Path("find/all/dbos/") -// List getDatabaseObjects(); -} diff --git a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java b/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java deleted file mode 100644 index ab2ec25..0000000 --- a/caf-database-object-rttest/src/main/java/io/iec/edp/caf/databaseobject/rttest/config/DatabaseObjectRtTestServiceConfiguration.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright © OpenAtom Foundation. - * 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 io.iec.edp.caf.databaseobject.rttest.config; - - - -import io.iec.edp.caf.databaseobject.rttest.DatabaseObjectRtTestServiceImpl; -import io.iec.edp.caf.databaseobject.rttest.api.IDatabaseObjectRtTestService; -import io.iec.edp.caf.rest.RESTEndpoint; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * @author liu_wei - */ -@Configuration -@EntityScan("io.iec.edp.caf.databaseobject.rttest.api") -public class DatabaseObjectRtTestServiceConfiguration { - - @Bean - public RESTEndpoint databaseObjectsTestEndpoint(IDatabaseObjectRtTestService databaseObjectRtTestService) { - return new RESTEndpoint( - "/runtime/sys/v1.0/database-objects-test", - databaseObjectRtTestService - ); - } - - @Bean - public IDatabaseObjectRtTestService databaseObjectRtTestService() { - return new DatabaseObjectRtTestServiceImpl(); - } -} diff --git a/caf-database-object-rttest/src/main/resources/META-INF/spring.factories b/caf-database-object-rttest/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 242c701..0000000 --- a/caf-database-object-rttest/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=io.iec.edp.caf.databaseobject.rttest.config.DatabaseObjectRtTestServiceConfiguration diff --git a/caf-database-object-spi/pom.xml b/caf-database-object-spi/pom.xml deleted file mode 100644 index 7a86cb5..0000000 --- a/caf-database-object-spi/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - caf-database-object - io.iec.edp - 0.3.0 - - 4.0.0 - jar - caf-database-object-spi - - - io.iec.edp - caf-database-object-api - ${project.version} - - - - - diff --git a/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java b/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java deleted file mode 100644 index 441eabb..0000000 --- a/caf-database-object-spi/src/main/java/io/iec/edp/caf/databaseobject/spi/ITableNameRuleManager.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright © OpenAtom Foundation. - * 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 io.iec.edp.caf.databaseobject.spi; - -import io.iec.edp.caf.databaseobject.api.entity.DBOTableNameRule; - -import java.util.List; -import java.util.Map; - -/** - * @author liu_wei - */ -public interface ITableNameRuleManager { - - String getTableName(String tableName, DBOTableNameRule rule, Map dimensionInfo); - - - List getTableNames(String tableName, DBOTableNameRule rule, Map> dimensioinInfo); -} diff --git a/pom.xml b/pom.xml index 7b97ad0..4339e2e 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,6 @@ caf-database-object-common caf-database-object-rtmanager caf-name-rule-extend - caf-database-object-spi caf-database-object-manager caf-database-object-deploy caf-database-object-deploy-spi @@ -38,7 +37,6 @@ caf-database-object-deploy-db2generator caf-database-object-deploy-gaussgenerator caf-database-object-rpcapi - caf-database-object-rttest -- Gitee From c060fd49a1989ce4af67da0eb59d0f78a9a87007 Mon Sep 17 00:00:00 2001 From: xuefengping02 Date: Tue, 11 Jul 2023 13:51:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- caf-database-object-rtmanager/pom.xml | 15 ------ .../rtmanager/DBOConfigDataCollectImpl.java | 38 ------------- .../rtmanager/DBOConfigDataCopyImpl.java | 53 ------------------- .../DatabaseObjectRtServiceConfiguration.java | 12 +---- 4 files changed, 1 insertion(+), 117 deletions(-) delete mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java delete mode 100644 caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java diff --git a/caf-database-object-rtmanager/pom.xml b/caf-database-object-rtmanager/pom.xml index 5c8a4a4..29ff3b6 100644 --- a/caf-database-object-rtmanager/pom.xml +++ b/caf-database-object-rtmanager/pom.xml @@ -115,20 +115,5 @@ 0.3.0 compile - - com.inspur.edp - metadata-rtcustomization-api - 0.1.32 - - - com.inspur.edp - metadata-rtcustomization-context - 0.1.32 - - - com.inspur.edp - metadata-rtcustomization-spi - 0.1.32 - diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java deleted file mode 100644 index a7ebaea..0000000 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCollectImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.iec.edp.caf.databaseobject.rtmanager; - -import com.inspur.edp.metadata.rtcustomization.api.entity.ConfigData; -import com.inspur.edp.metadata.rtcustomization.api.entity.MimicParamKeyEnum; -import com.inspur.edp.metadata.rtcustomization.api.entity.MimicTypeEnum; -import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCollectSpi; -import io.iec.edp.caf.commons.utils.SpringBeanUtils; -import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject; -import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - - -public class DBOConfigDataCollectImpl implements ConfigDataCollectSpi { - private static final String DBO_TABLE_NAME = "gspdatabaseobject"; - private GspDatabaseObjectRepository repository = (GspDatabaseObjectRepository)SpringBeanUtils.getBean(GspDatabaseObjectRepository.class); - - public DBOConfigDataCollectImpl() { - } - - public List configDataCollect(Map map) { - String boid = (String)map.get(MimicParamKeyEnum.BO_ID); - List databaseObjects = this.repository.findAllByBusinessObjectId(boid); - List configDataList = new ArrayList(); - ConfigData configData = new ConfigData(); - configData.setTargetClass(GspDatabaseObject.class.getName()); - configData.setTableName("gspdatabaseobject"); - configData.setEntityList(databaseObjects); - configDataList.add(configData); - return configDataList; - } - - public MimicTypeEnum getMimicTypeEnum() { - return MimicTypeEnum.COMMON_APP_COPY; - } -} diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java deleted file mode 100644 index 4583078..0000000 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/DBOConfigDataCopyImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package io.iec.edp.caf.databaseobject.rtmanager; - -import com.inspur.edp.metadata.rtcustomization.api.entity.ConfigData; -import com.inspur.edp.metadata.rtcustomization.api.entity.MimicParamKeyEnum; -import com.inspur.edp.metadata.rtcustomization.api.entity.MimicTypeEnum; -import com.inspur.edp.metadata.rtcustomization.context.MimicServiceContextHolder; -import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCopySpi; -import io.iec.edp.caf.commons.utils.SpringBeanUtils; -import io.iec.edp.caf.databaseobject.api.entity.GspDatabaseObject; -import io.iec.edp.caf.databaseobject.rtmanager.repository.GspDatabaseObjectRepository; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -public class DBOConfigDataCopyImpl implements ConfigDataCopySpi { - private GspDatabaseObjectRepository repository = (GspDatabaseObjectRepository) SpringBeanUtils.getBean(GspDatabaseObjectRepository.class); - - private static final String DBO_TABLE_NAME = "gspdatabaseobject"; - - public DBOConfigDataCopyImpl() { - } - - public void configDataCopy(Map map, ConfigData configData) { - if (configData.getTableName().equals("gspdatabaseobject")) { - List entityList = (List) configData.getEntityList(); - Iterator var4 = entityList.iterator(); - - while(var4.hasNext()) { - Object obj = var4.next(); - if (obj instanceof GspDatabaseObject) { - GspDatabaseObject table = (GspDatabaseObject)obj; - String newId = UUID.randomUUID().toString(); - String key = "gspdatabaseobject_id_" + table.getId(); - MimicServiceContextHolder.saveConfigData(key, newId); - table.setId(newId); - String dboCode = table.getCode(); - table.setCode(dboCode + System.currentTimeMillis()); - String businessObjectId=MimicServiceContextHolder.findConfigDataNewValue("gspbusinessobject_id_"+table.getBusinessObjectId()); - table.setBusinessObjectId(businessObjectId); - repository.save(table); - } - } - } - - } - - public MimicTypeEnum getMimicTypeEnum() { - return MimicTypeEnum.COMMON_APP_COPY; - } -} - diff --git a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java index 7054d48..aa5a8cd 100644 --- a/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java +++ b/caf-database-object-rtmanager/src/main/java/io/iec/edp/caf/databaseobject/rtmanager/config/DatabaseObjectRtServiceConfiguration.java @@ -19,8 +19,7 @@ package io.iec.edp.caf.databaseobject.rtmanager.config; -import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCollectSpi; -import com.inspur.edp.metadata.rtcustomization.spi.ConfigDataCopySpi; + import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDeployService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectDtService; import io.iec.edp.caf.databaseobject.api.service.IDatabaseObjectRtService; @@ -88,13 +87,4 @@ public class DatabaseObjectRtServiceConfiguration { public IDatabaseObjectTempTableService databaseObjectTempTableService(){ return new DatabaseObjectTempTableServiceImpl(); } - @Bean - public ConfigDataCollectSpi dboConfigDataCollect(){ - return new DBOConfigDataCollectImpl(); - } - - @Bean - public ConfigDataCopySpi dboConfigDataCopy(){ - return new DBOConfigDataCopyImpl(); - } } -- Gitee