From 0eb91630c2669d728703e23b2448e4859874c06a Mon Sep 17 00:00:00 2001 From: vran Date: Fri, 10 Jun 2022 14:36:39 +0800 Subject: [PATCH] fix: table description is empty (#240) * fix: table description is empty * fix: ut failed --- .../core/domain/document/service/DocumentService.java | 2 +- .../description/service/DocumentDescriptionServiceTest.java | 2 -- .../java/com/databasir/dao/impl/DocumentDescriptionDao.java | 5 ----- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/core/src/main/java/com/databasir/core/domain/document/service/DocumentService.java b/core/src/main/java/com/databasir/core/domain/document/service/DocumentService.java index 0e3ff66..0bf4370 100644 --- a/core/src/main/java/com/databasir/core/domain/document/service/DocumentService.java +++ b/core/src/main/java/com/databasir/core/domain/document/service/DocumentService.java @@ -86,7 +86,7 @@ public class DocumentService { .stream() .collect(Collectors.toMap(d -> d.getTableName(), d -> d.getCount(), (a, b) -> a)); var descriptionMapByTableName = - documentDescriptionDao.selectTableDescriptionByProjectId(projectId) + documentDescriptionDao.selectByProjectId(projectId) .stream() .collect(Collectors.toMap(d -> d.getTableName(), d -> d.getContent(), (a, b) -> a)); if (originalVersion != null) { diff --git a/core/src/test/java/com/databasir/core/domain/description/service/DocumentDescriptionServiceTest.java b/core/src/test/java/com/databasir/core/domain/description/service/DocumentDescriptionServiceTest.java index 7deb207..16a2fa8 100644 --- a/core/src/test/java/com/databasir/core/domain/description/service/DocumentDescriptionServiceTest.java +++ b/core/src/test/java/com/databasir/core/domain/description/service/DocumentDescriptionServiceTest.java @@ -40,8 +40,6 @@ class DocumentDescriptionServiceTest extends BaseTest { updateRequest.setColumnName("ut"); updateRequest.setContent("update content"); documentDescriptionService.save(groupId, projectId, userId, updateRequest); - var tableData = documentDescriptionDao.selectTableDescriptionByProjectId(projectId); - Assertions.assertEquals(0, tableData.size()); List descriptionData = documentDescriptionDao.selectByProjectId(projectId); Assertions.assertEquals(1, descriptionData.size()); } diff --git a/dao/src/main/java/com/databasir/dao/impl/DocumentDescriptionDao.java b/dao/src/main/java/com/databasir/dao/impl/DocumentDescriptionDao.java index 158cfa9..06a3423 100644 --- a/dao/src/main/java/com/databasir/dao/impl/DocumentDescriptionDao.java +++ b/dao/src/main/java/com/databasir/dao/impl/DocumentDescriptionDao.java @@ -49,11 +49,6 @@ public class DocumentDescriptionDao extends BaseDao { return selectByCondition(DOCUMENT_DESCRIPTION.PROJECT_ID.eq(projectId)); } - public List selectTableDescriptionByProjectId(Integer projectId) { - return selectByCondition(DOCUMENT_DESCRIPTION.PROJECT_ID.eq(projectId) - .and(DOCUMENT_DESCRIPTION.COLUMN_NAME.isNull())); - } - public List selectByCondition(Condition condition) { return this.getDslContext() .selectFrom(DOCUMENT_DESCRIPTION).where(condition)