提交 f6a34c06 authored 作者: ww1xhqc's avatar ww1xhqc

[数据模型] 可以删除基础延申对象

上级 d64bab52
...@@ -585,14 +585,14 @@ public class ModelImpl implements ModelService { ...@@ -585,14 +585,14 @@ public class ModelImpl implements ModelService {
} else { } else {
TableInfo tableInfo = byId.get(); TableInfo tableInfo = byId.get();
Integer modelType = tableInfo.getModelType(); Integer modelType = tableInfo.getModelType();
if (modelType.equals(ModelType.BUSINESS)) { if (modelType.equals(ModelType.BUSINESS)||modelType.equals(ModelType.BASICS_EXTENSION)) {
tableInfoDao.delete(tableInfo); tableInfoDao.delete(tableInfo);
List<ColumnInfo> allByDbId = columnInfoDao.findAllByDbId(delTableVO.getId()); List<ColumnInfo> allByDbId = columnInfoDao.findAllByDbId(delTableVO.getId());
columnInfoDao.deleteInBatch(allByDbId); columnInfoDao.deleteInBatch(allByDbId);
jdbcTemplate.execute("drop table " + tableInfo.getModelName()); // jdbcTemplate.execute("drop table " + tableInfo.getModelName());
return 1; return 1;
} }
} }
return 0; return 0;
} }
......
...@@ -59,8 +59,8 @@ public class SessionUtil { ...@@ -59,8 +59,8 @@ public class SessionUtil {
metadataSources.addInputStream(new ByteArrayInputStream(xmlStr.getBytes())); metadataSources.addInputStream(new ByteArrayInputStream(xmlStr.getBytes()));
Metadata metadata = metadataSources.buildMetadata(); Metadata metadata = metadataSources.buildMetadata();
//更新数据库Schema,如果不存在就创建表,存在就更新字段,不会影响已有数据 //更新数据库Schema,如果不存在就创建表,存在就更新字段,不会影响已有数据
SchemaUpdate schemaUpdate = new SchemaUpdate(); // SchemaUpdate schemaUpdate = new SchemaUpdate();
schemaUpdate.execute(EnumSet.of(TargetType.DATABASE), metadata, serviceRegistry); // schemaUpdate.execute(EnumSet.of(TargetType.DATABASE), metadata, serviceRegistry);
} }
public Session getSession(){ public Session getSession(){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论