change remark to discussion model & bug fix (#45)
* feat: change remark to discussion * feat: change remark model to discussion model * fix: sync duplicate column * feat:update frontend resources * fix: checkstyle
This commit is contained in:
parent
f026d406a2
commit
e85e0e6e70
|
@ -3,10 +3,10 @@ package com.databasir.api;
|
||||||
import com.databasir.api.config.security.DatabasirUserDetails;
|
import com.databasir.api.config.security.DatabasirUserDetails;
|
||||||
import com.databasir.common.JsonData;
|
import com.databasir.common.JsonData;
|
||||||
import com.databasir.core.domain.log.annotation.Operation;
|
import com.databasir.core.domain.log.annotation.Operation;
|
||||||
import com.databasir.core.domain.remark.data.RemarkCreateRequest;
|
import com.databasir.core.domain.remark.data.DiscussionCreateRequest;
|
||||||
import com.databasir.core.domain.remark.data.RemarkListCondition;
|
import com.databasir.core.domain.remark.data.DiscussionListCondition;
|
||||||
import com.databasir.core.domain.remark.data.RemarkResponse;
|
import com.databasir.core.domain.remark.data.DiscussionResponse;
|
||||||
import com.databasir.core.domain.remark.service.DocumentRemarkService;
|
import com.databasir.core.domain.remark.service.DocumentDiscussionService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
@ -22,46 +22,46 @@ import javax.validation.Valid;
|
||||||
@RestController
|
@RestController
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DocumentRemarkController {
|
public class DocumentDiscussionController {
|
||||||
|
|
||||||
private final DocumentRemarkService documentRemarkService;
|
private final DocumentDiscussionService documentDiscussionService;
|
||||||
|
|
||||||
@GetMapping(Routes.DocumentRemark.LIST)
|
@GetMapping(Routes.DocumentDiscussion.LIST)
|
||||||
public JsonData<Page<RemarkResponse>> listByProjectId(@PathVariable Integer groupId,
|
public JsonData<Page<DiscussionResponse>> listByProjectId(@PathVariable Integer groupId,
|
||||||
@PathVariable Integer projectId,
|
@PathVariable Integer projectId,
|
||||||
@PageableDefault(sort = "id",
|
@PageableDefault(sort = "id",
|
||||||
direction = Sort.Direction.DESC)
|
direction = Sort.Direction.DESC)
|
||||||
Pageable request,
|
Pageable request,
|
||||||
RemarkListCondition condition) {
|
DiscussionListCondition condition) {
|
||||||
var data = documentRemarkService.list(groupId, projectId, request, condition);
|
var data = documentDiscussionService.list(groupId, projectId, request, condition);
|
||||||
return JsonData.ok(data);
|
return JsonData.ok(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping(Routes.DocumentRemark.DELETE)
|
@DeleteMapping(Routes.DocumentDiscussion.DELETE)
|
||||||
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId)")
|
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId)")
|
||||||
@Operation(module = Operation.Modules.PROJECT,
|
@Operation(module = Operation.Modules.PROJECT,
|
||||||
name = "删除评论",
|
name = "删除评论",
|
||||||
involvedProjectId = "#projectId")
|
involvedProjectId = "#projectId")
|
||||||
public JsonData<Void> delete(@PathVariable Integer groupId,
|
public JsonData<Void> delete(@PathVariable Integer groupId,
|
||||||
@PathVariable Integer projectId,
|
@PathVariable Integer projectId,
|
||||||
@PathVariable Integer remarkId) {
|
@PathVariable Integer discussionId) {
|
||||||
documentRemarkService.deleteById(groupId, projectId, remarkId);
|
documentDiscussionService.deleteById(groupId, projectId, discussionId);
|
||||||
return JsonData.ok();
|
return JsonData.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(Routes.DocumentRemark.CREATE)
|
@PostMapping(Routes.DocumentDiscussion.CREATE)
|
||||||
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId, 'GROUP_MEMBER?groupId='+#groupId)")
|
@PreAuthorize("hasAnyAuthority('SYS_OWNER', 'GROUP_OWNER?groupId='+#groupId, 'GROUP_MEMBER?groupId='+#groupId)")
|
||||||
@Operation(module = Operation.Modules.PROJECT,
|
@Operation(module = Operation.Modules.PROJECT,
|
||||||
name = "新增评论",
|
name = "新增评论",
|
||||||
involvedProjectId = "#projectId")
|
involvedProjectId = "#projectId")
|
||||||
public JsonData<Void> create(@PathVariable Integer groupId,
|
public JsonData<Void> create(@PathVariable Integer groupId,
|
||||||
@PathVariable Integer projectId,
|
@PathVariable Integer projectId,
|
||||||
@RequestBody @Valid RemarkCreateRequest request) {
|
@RequestBody @Valid DiscussionCreateRequest request) {
|
||||||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||||
.getAuthentication()
|
.getAuthentication()
|
||||||
.getPrincipal();
|
.getPrincipal();
|
||||||
Integer userId = principal.getUserPojo().getId();
|
Integer userId = principal.getUserPojo().getId();
|
||||||
documentRemarkService.create(groupId, projectId, userId, request);
|
documentDiscussionService.create(groupId, projectId, userId, request);
|
||||||
return JsonData.ok();
|
return JsonData.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -85,13 +85,15 @@ public interface Routes {
|
||||||
String EXPORT = BASE + "/projects/{projectId}/document_files";
|
String EXPORT = BASE + "/projects/{projectId}/document_files";
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DocumentRemark {
|
interface DocumentDiscussion {
|
||||||
|
|
||||||
String LIST = BASE + "/groups/{groupId}/projects/{projectId}/remarks";
|
String DISCUSSION_BASE = BASE + "/groups/{groupId}/projects/{projectId}/discussions";
|
||||||
|
|
||||||
String CREATE = BASE + "/groups/{groupId}/projects/{projectId}/remarks";
|
String LIST = DISCUSSION_BASE;
|
||||||
|
|
||||||
String DELETE = BASE + "/groups/{groupId}/projects/{projectId}/remarks/{remarkId}";
|
String CREATE = DISCUSSION_BASE;
|
||||||
|
|
||||||
|
String DELETE = DISCUSSION_BASE + "/{discussionId}";
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Setting {
|
interface Setting {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.a4b9bb20.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.2527a373.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.6aec33ce.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.b19c33c1.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -6,10 +6,14 @@ import com.databasir.core.domain.database.data.DatabaseTypePageResponse;
|
||||||
import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest;
|
import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest;
|
||||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
|
||||||
@Mapper(componentModel = "spring")
|
@Mapper(componentModel = "spring")
|
||||||
public interface DatabaseTypePojoConverter {
|
public interface DatabaseTypePojoConverter {
|
||||||
|
|
||||||
|
@Mapping(target = "id", ignore = true)
|
||||||
|
@Mapping(target = "updateAt", ignore = true)
|
||||||
|
@Mapping(target = "createAt", ignore = true)
|
||||||
DatabaseTypePojo of(DatabaseTypeCreateRequest request);
|
DatabaseTypePojo of(DatabaseTypeCreateRequest request);
|
||||||
|
|
||||||
DatabaseTypePojo of(DatabaseTypeUpdateRequest request);
|
DatabaseTypePojo of(DatabaseTypeUpdateRequest request);
|
||||||
|
|
|
@ -8,6 +8,8 @@ import org.mapstruct.Mapping;
|
||||||
import org.mapstruct.ReportingPolicy;
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Mapper(componentModel = "spring", uses = JsonConverter.class, unmappedTargetPolicy = ReportingPolicy.WARN)
|
@Mapper(componentModel = "spring", uses = JsonConverter.class, unmappedTargetPolicy = ReportingPolicy.WARN)
|
||||||
public interface DocumentResponseConverter {
|
public interface DocumentResponseConverter {
|
||||||
|
@ -20,6 +22,31 @@ public interface DocumentResponseConverter {
|
||||||
List<TableIndexDocumentPojo> indexes,
|
List<TableIndexDocumentPojo> indexes,
|
||||||
List<TableTriggerDocumentPojo> triggers);
|
List<TableTriggerDocumentPojo> triggers);
|
||||||
|
|
||||||
|
@Mapping(target = "columns", source = "columns")
|
||||||
|
@Mapping(target = "indexes", source = "indexes")
|
||||||
|
@Mapping(target = "triggers", source = "triggers")
|
||||||
|
@SuppressWarnings("checkstyle:all")
|
||||||
|
DatabaseDocumentResponse.TableDocumentResponse of(TableDocumentPojo tableDocument,
|
||||||
|
Integer discussionCount,
|
||||||
|
List<DatabaseDocumentResponse.TableDocumentResponse.ColumnDocumentResponse> columns,
|
||||||
|
List<TableIndexDocumentPojo> indexes,
|
||||||
|
List<TableTriggerDocumentPojo> triggers);
|
||||||
|
|
||||||
|
DatabaseDocumentResponse.TableDocumentResponse.ColumnDocumentResponse of(TableColumnDocumentPojo pojo,
|
||||||
|
Integer discussionCount);
|
||||||
|
|
||||||
|
default List<DatabaseDocumentResponse.TableDocumentResponse.ColumnDocumentResponse> of(
|
||||||
|
List<TableColumnDocumentPojo> columns,
|
||||||
|
String tableName,
|
||||||
|
Map<String, Integer> discussionCountMapByJoinName) {
|
||||||
|
return columns.stream()
|
||||||
|
.map(column -> {
|
||||||
|
Integer count = discussionCountMapByJoinName.get(tableName + "." + column.getName());
|
||||||
|
return of(column, count);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
@Mapping(target = "columnNames", source = "columnNameArray")
|
@Mapping(target = "columnNames", source = "columnNameArray")
|
||||||
DatabaseDocumentResponse.TableDocumentResponse.IndexDocumentResponse of(TableIndexDocumentPojo indexDocument);
|
DatabaseDocumentResponse.TableDocumentResponse.IndexDocumentResponse of(TableIndexDocumentPojo indexDocument);
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,8 @@ import org.mapstruct.Mapping;
|
||||||
import org.mapstruct.ReportingPolicy;
|
import org.mapstruct.ReportingPolicy;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Mapper(componentModel = "spring", uses = JsonConverter.class, unmappedTargetPolicy = ReportingPolicy.WARN)
|
@Mapper(componentModel = "spring", uses = JsonConverter.class, unmappedTargetPolicy = ReportingPolicy.WARN)
|
||||||
public interface DocumentSimpleResponseConverter {
|
public interface DocumentSimpleResponseConverter {
|
||||||
|
@ -17,5 +19,17 @@ public interface DocumentSimpleResponseConverter {
|
||||||
@Mapping(target = "createAt", source = "databaseDocument.createAt")
|
@Mapping(target = "createAt", source = "databaseDocument.createAt")
|
||||||
@Mapping(target = "documentVersion", source = "databaseDocument.version")
|
@Mapping(target = "documentVersion", source = "databaseDocument.version")
|
||||||
DatabaseDocumentSimpleResponse of(DatabaseDocumentPojo databaseDocument,
|
DatabaseDocumentSimpleResponse of(DatabaseDocumentPojo databaseDocument,
|
||||||
List<TableDocumentPojo> tables);
|
List<DatabaseDocumentSimpleResponse.TableData> tables);
|
||||||
|
|
||||||
|
DatabaseDocumentSimpleResponse.TableData of(TableDocumentPojo tables, Integer discussionCount);
|
||||||
|
|
||||||
|
default List<DatabaseDocumentSimpleResponse.TableData> of(List<TableDocumentPojo> tables,
|
||||||
|
Map<String, Integer> discussionCountMapByTableName) {
|
||||||
|
return tables.stream()
|
||||||
|
.map(table -> {
|
||||||
|
Integer count = discussionCountMapByTableName.get(table.getName());
|
||||||
|
return of(table, count);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,8 @@ public class DatabaseDocumentResponse {
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
|
private Integer discussionCount;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private List<ColumnDocumentResponse> columns = new ArrayList<>();
|
private List<ColumnDocumentResponse> columns = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -82,6 +84,8 @@ public class DatabaseDocumentResponse {
|
||||||
|
|
||||||
private String defaultValue;
|
private String defaultValue;
|
||||||
|
|
||||||
|
private Integer discussionCount;
|
||||||
|
|
||||||
private LocalDateTime createAt;
|
private LocalDateTime createAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,5 +35,7 @@ public class DatabaseDocumentSimpleResponse {
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
|
private Integer discussionCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,10 @@ import com.databasir.core.meta.data.DatabaseMeta;
|
||||||
import com.databasir.core.render.markdown.MarkdownBuilder;
|
import com.databasir.core.render.markdown.MarkdownBuilder;
|
||||||
import com.databasir.dao.impl.*;
|
import com.databasir.dao.impl.*;
|
||||||
import com.databasir.dao.tables.pojos.*;
|
import com.databasir.dao.tables.pojos.*;
|
||||||
|
import com.databasir.dao.value.DocumentDiscussionCountPojo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jooq.tools.StringUtils;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -55,6 +57,8 @@ public class DocumentService {
|
||||||
|
|
||||||
private final TableTriggerDocumentDao tableTriggerDocumentDao;
|
private final TableTriggerDocumentDao tableTriggerDocumentDao;
|
||||||
|
|
||||||
|
private final DocumentDiscussionDao documentDiscussionDao;
|
||||||
|
|
||||||
private final DocumentPojoConverter documentPojoConverter;
|
private final DocumentPojoConverter documentPojoConverter;
|
||||||
|
|
||||||
private final DocumentResponseConverter documentResponseConverter;
|
private final DocumentResponseConverter documentResponseConverter;
|
||||||
|
@ -129,21 +133,22 @@ public class DocumentService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<DatabaseDocumentSimpleResponse> getSimpleOneByProjectId(Integer projectId, Long version) {
|
public Optional<DatabaseDocumentSimpleResponse> getSimpleOneByProjectId(Integer projectId, Long version) {
|
||||||
|
Optional<DatabaseDocumentPojo> documentOption;
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
return databaseDocumentDao.selectNotArchivedByProjectId(projectId)
|
documentOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||||
.map(document -> {
|
|
||||||
Integer id = document.getId();
|
|
||||||
var tables = tableDocumentDao.selectByDatabaseDocumentId(id);
|
|
||||||
return documentSimpleResponseConverter.of(document, tables);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
return databaseDocumentDao.selectOptionalByProjectIdAndVersion(projectId, version)
|
documentOption = databaseDocumentDao.selectOptionalByProjectIdAndVersion(projectId, version);
|
||||||
.map(document -> {
|
|
||||||
Integer id = document.getId();
|
|
||||||
var tables = tableDocumentDao.selectByDatabaseDocumentId(id);
|
|
||||||
return documentSimpleResponseConverter.of(document, tables);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
return documentOption.map(document -> {
|
||||||
|
Integer id = document.getId();
|
||||||
|
var tables = tableDocumentDao.selectByDatabaseDocumentId(id);
|
||||||
|
var discussionCountMapByTableName =
|
||||||
|
documentDiscussionDao.selectTableDiscussionCount(projectId)
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(d -> d.getTableName(), d -> d.getCount(), (a, b) -> a));
|
||||||
|
var tableMetas = documentSimpleResponseConverter.of(tables, discussionCountMapByTableName);
|
||||||
|
return documentSimpleResponseConverter.of(document, tableMetas);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<DatabaseDocumentResponse> getOneByProjectId(Integer projectId, Long version) {
|
public Optional<DatabaseDocumentResponse> getOneByProjectId(Integer projectId, Long version) {
|
||||||
|
@ -207,19 +212,31 @@ public class DocumentService {
|
||||||
tableIndexDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
tableIndexDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
||||||
var triggers =
|
var triggers =
|
||||||
tableTriggerDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
tableTriggerDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
||||||
|
var discussions = documentDiscussionDao.selectAllDiscussionCount(projectId);
|
||||||
Map<Integer, List<TableColumnDocumentPojo>> columnsGroupByTableMetaId = columns.stream()
|
Map<Integer, List<TableColumnDocumentPojo>> columnsGroupByTableMetaId = columns.stream()
|
||||||
.collect(Collectors.groupingBy(TableColumnDocumentPojo::getTableDocumentId));
|
.collect(Collectors.groupingBy(TableColumnDocumentPojo::getTableDocumentId));
|
||||||
Map<Integer, List<TableIndexDocumentPojo>> indexesGroupByTableMetaId = indexes.stream()
|
Map<Integer, List<TableIndexDocumentPojo>> indexesGroupByTableMetaId = indexes.stream()
|
||||||
.collect(Collectors.groupingBy(TableIndexDocumentPojo::getTableDocumentId));
|
.collect(Collectors.groupingBy(TableIndexDocumentPojo::getTableDocumentId));
|
||||||
Map<Integer, List<TableTriggerDocumentPojo>> triggersGroupByTableMetaId = triggers.stream()
|
Map<Integer, List<TableTriggerDocumentPojo>> triggersGroupByTableMetaId = triggers.stream()
|
||||||
.collect(Collectors.groupingBy(TableTriggerDocumentPojo::getTableDocumentId));
|
.collect(Collectors.groupingBy(TableTriggerDocumentPojo::getTableDocumentId));
|
||||||
|
Map<String, Integer> discussionCountMapByJoinName = discussions.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
d -> String.join(".",
|
||||||
|
d.getTableName(),
|
||||||
|
StringUtils.defaultIfBlank(d.getColumnName(), "")),
|
||||||
|
DocumentDiscussionCountPojo::getCount,
|
||||||
|
(a, b) -> a));
|
||||||
return tables.stream()
|
return tables.stream()
|
||||||
.map(table -> {
|
.map(table -> {
|
||||||
Integer tableId = table.getId();
|
Integer tableId = table.getId();
|
||||||
var subColumns = columnsGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
var subColumns = columnsGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
||||||
var subIndexes = indexesGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
var subIndexes = indexesGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
||||||
var subTriggers = triggersGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
var subTriggers = triggersGroupByTableMetaId.getOrDefault(tableId, Collections.emptyList());
|
||||||
return documentResponseConverter.of(table, subColumns, subIndexes, subTriggers);
|
var discussionCount = discussionCountMapByJoinName.get(table.getName());
|
||||||
|
var columnResponses =
|
||||||
|
documentResponseConverter.of(subColumns, table.getName(), discussionCountMapByJoinName);
|
||||||
|
return documentResponseConverter.of(table, discussionCount, columnResponses, subIndexes,
|
||||||
|
subTriggers);
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.databasir.core.domain.remark.converter;
|
||||||
|
|
||||||
|
import com.databasir.core.domain.remark.data.DiscussionResponse;
|
||||||
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||||
|
import com.databasir.dao.tables.pojos.UserPojo;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface DiscussionResponseConverter {
|
||||||
|
|
||||||
|
@Mapping(target = "id", source = "discussion.id")
|
||||||
|
@Mapping(target = "createAt", source = "discussion.createAt")
|
||||||
|
@Mapping(target = "content", source = "discussion.content")
|
||||||
|
DiscussionResponse of(DocumentDiscussionPojo discussion,
|
||||||
|
UserPojo discussBy);
|
||||||
|
}
|
|
@ -1,19 +0,0 @@
|
||||||
package com.databasir.core.domain.remark.converter;
|
|
||||||
|
|
||||||
import com.databasir.core.domain.remark.data.RemarkResponse;
|
|
||||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
|
|
||||||
import com.databasir.dao.tables.pojos.UserPojo;
|
|
||||||
import org.mapstruct.Mapper;
|
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
|
|
||||||
@Mapper(componentModel = "spring")
|
|
||||||
public interface RemarkResponseConverter {
|
|
||||||
|
|
||||||
@Mapping(target = "remarkBy.userId", source = "remarkBy.id")
|
|
||||||
@Mapping(target = "remarkBy.nickname", source = "remarkBy.nickname")
|
|
||||||
@Mapping(target = "remarkBy.email", source = "remarkBy.email")
|
|
||||||
@Mapping(target = "id", source = "remark.id")
|
|
||||||
@Mapping(target = "createAt", source = "remark.createAt")
|
|
||||||
RemarkResponse of(DocumentRemarkPojo remark,
|
|
||||||
UserPojo remarkBy);
|
|
||||||
}
|
|
|
@ -6,10 +6,10 @@ import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class RemarkCreateRequest {
|
public class DiscussionCreateRequest {
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String remark;
|
private String content;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private String tableName;
|
private String tableName;
|
|
@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class RemarkListCondition {
|
public class DiscussionListCondition {
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
@ -19,17 +19,17 @@ public class RemarkListCondition {
|
||||||
|
|
||||||
public Condition toCondition(Integer projectId) {
|
public Condition toCondition(Integer projectId) {
|
||||||
List<Condition> conditions = new ArrayList<>();
|
List<Condition> conditions = new ArrayList<>();
|
||||||
Condition condition = Tables.DOCUMENT_REMARK.TABLE_NAME.eq(tableName);
|
Condition condition = Tables.DOCUMENT_DISCUSSION.TABLE_NAME.eq(tableName);
|
||||||
conditions.add(condition);
|
conditions.add(condition);
|
||||||
|
|
||||||
Condition columnCondition;
|
Condition columnCondition;
|
||||||
if (columnName != null) {
|
if (columnName != null) {
|
||||||
columnCondition = Tables.DOCUMENT_REMARK.COLUMN_NAME.eq(columnName);
|
columnCondition = Tables.DOCUMENT_DISCUSSION.COLUMN_NAME.eq(columnName);
|
||||||
} else {
|
} else {
|
||||||
columnCondition = Tables.DOCUMENT_REMARK.COLUMN_NAME.isNull();
|
columnCondition = Tables.DOCUMENT_DISCUSSION.COLUMN_NAME.isNull();
|
||||||
}
|
}
|
||||||
conditions.add(columnCondition);
|
conditions.add(columnCondition);
|
||||||
conditions.add(Tables.DOCUMENT_REMARK.PROJECT_ID.eq(projectId));
|
conditions.add(Tables.DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId));
|
||||||
return conditions.stream().reduce(Condition::and).orElse(DSL.trueCondition());
|
return conditions.stream().reduce(Condition::and).orElse(DSL.trueCondition());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,20 +5,20 @@ import lombok.Data;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class RemarkResponse {
|
public class DiscussionResponse {
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private Integer projectId;
|
private Integer projectId;
|
||||||
|
|
||||||
private String remark;
|
private String content;
|
||||||
|
|
||||||
private RemarkUser remarkBy;
|
private DiscussByUser discussBy;
|
||||||
|
|
||||||
private LocalDateTime createAt;
|
private LocalDateTime createAt;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class RemarkUser {
|
public static class DiscussByUser {
|
||||||
|
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package com.databasir.core.domain.remark.service;
|
package com.databasir.core.domain.remark.service;
|
||||||
|
|
||||||
import com.databasir.common.exception.Forbidden;
|
import com.databasir.common.exception.Forbidden;
|
||||||
import com.databasir.core.domain.remark.converter.RemarkResponseConverter;
|
import com.databasir.core.domain.remark.converter.DiscussionResponseConverter;
|
||||||
import com.databasir.core.domain.remark.data.RemarkCreateRequest;
|
import com.databasir.core.domain.remark.data.DiscussionCreateRequest;
|
||||||
import com.databasir.core.domain.remark.data.RemarkListCondition;
|
import com.databasir.core.domain.remark.data.DiscussionListCondition;
|
||||||
import com.databasir.core.domain.remark.data.RemarkResponse;
|
import com.databasir.core.domain.remark.data.DiscussionResponse;
|
||||||
import com.databasir.dao.impl.DocumentRemarkDao;
|
import com.databasir.dao.impl.DocumentDiscussionDao;
|
||||||
import com.databasir.dao.impl.ProjectDao;
|
import com.databasir.dao.impl.ProjectDao;
|
||||||
import com.databasir.dao.impl.UserDao;
|
import com.databasir.dao.impl.UserDao;
|
||||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||||
import com.databasir.dao.tables.pojos.UserPojo;
|
import com.databasir.dao.tables.pojos.UserPojo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
@ -22,58 +22,59 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DocumentRemarkService {
|
public class DocumentDiscussionService {
|
||||||
|
|
||||||
private final DocumentRemarkDao documentRemarkDao;
|
private final DocumentDiscussionDao documentDiscussionDao;
|
||||||
|
|
||||||
private final ProjectDao projectDao;
|
private final ProjectDao projectDao;
|
||||||
|
|
||||||
private final UserDao userDao;
|
private final UserDao userDao;
|
||||||
|
|
||||||
private final RemarkResponseConverter remarkResponseConverter;
|
private final DiscussionResponseConverter discussionResponseConverter;
|
||||||
|
|
||||||
public void deleteById(Integer groupId,
|
public void deleteById(Integer groupId,
|
||||||
Integer projectId,
|
Integer projectId,
|
||||||
Integer remarkId) {
|
Integer discussionId) {
|
||||||
if (projectDao.exists(groupId, projectId)) {
|
if (projectDao.exists(groupId, projectId)) {
|
||||||
documentRemarkDao.deleteById(remarkId);
|
documentDiscussionDao.deleteById(discussionId);
|
||||||
} else {
|
} else {
|
||||||
throw new Forbidden();
|
throw new Forbidden();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<RemarkResponse> list(Integer groupId,
|
public Page<DiscussionResponse> list(Integer groupId,
|
||||||
Integer projectId,
|
Integer projectId,
|
||||||
Pageable pageable,
|
Pageable pageable,
|
||||||
RemarkListCondition condition) {
|
DiscussionListCondition condition) {
|
||||||
if (projectDao.exists(groupId, projectId)) {
|
if (projectDao.exists(groupId, projectId)) {
|
||||||
Page<DocumentRemarkPojo> data = documentRemarkDao.selectByPage(pageable, condition.toCondition(projectId));
|
Page<DocumentDiscussionPojo> data =
|
||||||
|
documentDiscussionDao.selectByPage(pageable, condition.toCondition(projectId));
|
||||||
Set<Integer> userIdList = data.getContent()
|
Set<Integer> userIdList = data.getContent()
|
||||||
.stream()
|
.stream()
|
||||||
.map(DocumentRemarkPojo::getUserId)
|
.map(DocumentDiscussionPojo::getUserId)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
Map<Integer, UserPojo> userMapById = userDao.selectUserIdIn(userIdList)
|
Map<Integer, UserPojo> userMapById = userDao.selectUserIdIn(userIdList)
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(UserPojo::getId, Function.identity()));
|
.collect(Collectors.toMap(UserPojo::getId, Function.identity()));
|
||||||
return data
|
return data
|
||||||
.map(remarkPojo -> {
|
.map(dicussionPojo -> {
|
||||||
UserPojo userPojo = userMapById.get(remarkPojo.getUserId());
|
UserPojo userPojo = userMapById.get(dicussionPojo.getUserId());
|
||||||
return remarkResponseConverter.of(remarkPojo, userPojo);
|
return discussionResponseConverter.of(dicussionPojo, userPojo);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
throw new Forbidden();
|
throw new Forbidden();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void create(Integer groupId, Integer projectId, Integer userId, RemarkCreateRequest request) {
|
public void create(Integer groupId, Integer projectId, Integer userId, DiscussionCreateRequest request) {
|
||||||
if (projectDao.exists(groupId, projectId)) {
|
if (projectDao.exists(groupId, projectId)) {
|
||||||
DocumentRemarkPojo pojo = new DocumentRemarkPojo();
|
DocumentDiscussionPojo pojo = new DocumentDiscussionPojo();
|
||||||
pojo.setUserId(userId);
|
pojo.setUserId(userId);
|
||||||
pojo.setProjectId(projectId);
|
pojo.setProjectId(projectId);
|
||||||
pojo.setRemark(request.getRemark());
|
pojo.setContent(request.getContent());
|
||||||
pojo.setTableName(request.getTableName());
|
pojo.setTableName(request.getTableName());
|
||||||
pojo.setColumnName(request.getColumnName());
|
pojo.setColumnName(request.getColumnName());
|
||||||
documentRemarkDao.insertAndReturnId(pojo);
|
documentDiscussionDao.insertAndReturnId(pojo);
|
||||||
} else {
|
} else {
|
||||||
throw new Forbidden();
|
throw new Forbidden();
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@ import com.databasir.dao.tables.DataSource;
|
||||||
import com.databasir.dao.tables.DataSourceProperty;
|
import com.databasir.dao.tables.DataSourceProperty;
|
||||||
import com.databasir.dao.tables.DatabaseDocument;
|
import com.databasir.dao.tables.DatabaseDocument;
|
||||||
import com.databasir.dao.tables.DatabaseType;
|
import com.databasir.dao.tables.DatabaseType;
|
||||||
import com.databasir.dao.tables.DocumentRemark;
|
import com.databasir.dao.tables.DocumentDiscussion;
|
||||||
import com.databasir.dao.tables.Group;
|
import com.databasir.dao.tables.Group;
|
||||||
import com.databasir.dao.tables.Login;
|
import com.databasir.dao.tables.Login;
|
||||||
import com.databasir.dao.tables.OauthApp;
|
import com.databasir.dao.tables.OauthApp;
|
||||||
|
@ -67,9 +67,9 @@ public class Databasir extends SchemaImpl {
|
||||||
public final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
public final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table <code>databasir.document_remark</code>.
|
* The table <code>databasir.document_discussion</code>.
|
||||||
*/
|
*/
|
||||||
public final DocumentRemark DOCUMENT_REMARK = DocumentRemark.DOCUMENT_REMARK;
|
public final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table <code>databasir.group</code>.
|
* The table <code>databasir.group</code>.
|
||||||
|
@ -166,7 +166,7 @@ public class Databasir extends SchemaImpl {
|
||||||
DataSourceProperty.DATA_SOURCE_PROPERTY,
|
DataSourceProperty.DATA_SOURCE_PROPERTY,
|
||||||
DatabaseDocument.DATABASE_DOCUMENT,
|
DatabaseDocument.DATABASE_DOCUMENT,
|
||||||
DatabaseType.DATABASE_TYPE,
|
DatabaseType.DATABASE_TYPE,
|
||||||
DocumentRemark.DOCUMENT_REMARK,
|
DocumentDiscussion.DOCUMENT_DISCUSSION,
|
||||||
Group.GROUP,
|
Group.GROUP,
|
||||||
Login.LOGIN,
|
Login.LOGIN,
|
||||||
OauthApp.OAUTH_APP,
|
OauthApp.OAUTH_APP,
|
||||||
|
|
|
@ -6,7 +6,7 @@ package com.databasir.dao;
|
||||||
|
|
||||||
import com.databasir.dao.tables.DataSourceProperty;
|
import com.databasir.dao.tables.DataSourceProperty;
|
||||||
import com.databasir.dao.tables.DatabaseDocument;
|
import com.databasir.dao.tables.DatabaseDocument;
|
||||||
import com.databasir.dao.tables.DocumentRemark;
|
import com.databasir.dao.tables.DocumentDiscussion;
|
||||||
import com.databasir.dao.tables.TableColumnDocument;
|
import com.databasir.dao.tables.TableColumnDocument;
|
||||||
import com.databasir.dao.tables.TableDocument;
|
import com.databasir.dao.tables.TableDocument;
|
||||||
import com.databasir.dao.tables.TableIndexDocument;
|
import com.databasir.dao.tables.TableIndexDocument;
|
||||||
|
@ -34,7 +34,7 @@ public class Indexes {
|
||||||
public static final Index TABLE_INDEX_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
public static final Index TABLE_INDEX_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||||
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||||
public static final Index DATABASE_DOCUMENT_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DatabaseDocument.DATABASE_DOCUMENT, new OrderField[] { DatabaseDocument.DATABASE_DOCUMENT.PROJECT_ID }, false);
|
public static final Index DATABASE_DOCUMENT_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DatabaseDocument.DATABASE_DOCUMENT, new OrderField[] { DatabaseDocument.DATABASE_DOCUMENT.PROJECT_ID }, false);
|
||||||
public static final Index DOCUMENT_REMARK_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DocumentRemark.DOCUMENT_REMARK, new OrderField[] { DocumentRemark.DOCUMENT_REMARK.PROJECT_ID }, false);
|
public static final Index DOCUMENT_DISCUSSION_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DocumentDiscussion.DOCUMENT_DISCUSSION, new OrderField[] { DocumentDiscussion.DOCUMENT_DISCUSSION.PROJECT_ID }, false);
|
||||||
public static final Index TABLE_COLUMN_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableColumnDocument.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
public static final Index TABLE_COLUMN_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableColumnDocument.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||||
public static final Index TABLE_INDEX_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
public static final Index TABLE_INDEX_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableIndexDocument.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||||
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
public static final Index TABLE_TRIGGER_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import com.databasir.dao.tables.DataSource;
|
||||||
import com.databasir.dao.tables.DataSourceProperty;
|
import com.databasir.dao.tables.DataSourceProperty;
|
||||||
import com.databasir.dao.tables.DatabaseDocument;
|
import com.databasir.dao.tables.DatabaseDocument;
|
||||||
import com.databasir.dao.tables.DatabaseType;
|
import com.databasir.dao.tables.DatabaseType;
|
||||||
import com.databasir.dao.tables.DocumentRemark;
|
import com.databasir.dao.tables.DocumentDiscussion;
|
||||||
import com.databasir.dao.tables.Group;
|
import com.databasir.dao.tables.Group;
|
||||||
import com.databasir.dao.tables.Login;
|
import com.databasir.dao.tables.Login;
|
||||||
import com.databasir.dao.tables.OauthApp;
|
import com.databasir.dao.tables.OauthApp;
|
||||||
|
@ -28,7 +28,7 @@ import com.databasir.dao.tables.records.DataSourcePropertyRecord;
|
||||||
import com.databasir.dao.tables.records.DataSourceRecord;
|
import com.databasir.dao.tables.records.DataSourceRecord;
|
||||||
import com.databasir.dao.tables.records.DatabaseDocumentRecord;
|
import com.databasir.dao.tables.records.DatabaseDocumentRecord;
|
||||||
import com.databasir.dao.tables.records.DatabaseTypeRecord;
|
import com.databasir.dao.tables.records.DatabaseTypeRecord;
|
||||||
import com.databasir.dao.tables.records.DocumentRemarkRecord;
|
import com.databasir.dao.tables.records.DocumentDiscussionRecord;
|
||||||
import com.databasir.dao.tables.records.GroupRecord;
|
import com.databasir.dao.tables.records.GroupRecord;
|
||||||
import com.databasir.dao.tables.records.LoginRecord;
|
import com.databasir.dao.tables.records.LoginRecord;
|
||||||
import com.databasir.dao.tables.records.OauthAppRecord;
|
import com.databasir.dao.tables.records.OauthAppRecord;
|
||||||
|
@ -68,7 +68,7 @@ public class Keys {
|
||||||
public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_PRIMARY = Internal.createUniqueKey(DatabaseDocument.DATABASE_DOCUMENT, DSL.name("KEY_database_document_PRIMARY"), new TableField[] { DatabaseDocument.DATABASE_DOCUMENT.ID }, true);
|
public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_PRIMARY = Internal.createUniqueKey(DatabaseDocument.DATABASE_DOCUMENT, DSL.name("KEY_database_document_PRIMARY"), new TableField[] { DatabaseDocument.DATABASE_DOCUMENT.ID }, true);
|
||||||
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_PRIMARY = Internal.createUniqueKey(DatabaseType.DATABASE_TYPE, DSL.name("KEY_database_type_PRIMARY"), new TableField[] { DatabaseType.DATABASE_TYPE.ID }, true);
|
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_PRIMARY = Internal.createUniqueKey(DatabaseType.DATABASE_TYPE, DSL.name("KEY_database_type_PRIMARY"), new TableField[] { DatabaseType.DATABASE_TYPE.ID }, true);
|
||||||
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_UK_DATABASE_TYPE_DELETED_DELETED_TOKEN = Internal.createUniqueKey(DatabaseType.DATABASE_TYPE, DSL.name("KEY_database_type_uk_database_type_deleted_deleted_token"), new TableField[] { DatabaseType.DATABASE_TYPE.DATABASE_TYPE_, DatabaseType.DATABASE_TYPE.DELETED, DatabaseType.DATABASE_TYPE.DELETED_TOKEN }, true);
|
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_UK_DATABASE_TYPE_DELETED_DELETED_TOKEN = Internal.createUniqueKey(DatabaseType.DATABASE_TYPE, DSL.name("KEY_database_type_uk_database_type_deleted_deleted_token"), new TableField[] { DatabaseType.DATABASE_TYPE.DATABASE_TYPE_, DatabaseType.DATABASE_TYPE.DELETED, DatabaseType.DATABASE_TYPE.DELETED_TOKEN }, true);
|
||||||
public static final UniqueKey<DocumentRemarkRecord> KEY_DOCUMENT_REMARK_PRIMARY = Internal.createUniqueKey(DocumentRemark.DOCUMENT_REMARK, DSL.name("KEY_document_remark_PRIMARY"), new TableField[] { DocumentRemark.DOCUMENT_REMARK.ID }, true);
|
public static final UniqueKey<DocumentDiscussionRecord> KEY_DOCUMENT_DISCUSSION_PRIMARY = Internal.createUniqueKey(DocumentDiscussion.DOCUMENT_DISCUSSION, DSL.name("KEY_document_discussion_PRIMARY"), new TableField[] { DocumentDiscussion.DOCUMENT_DISCUSSION.ID }, true);
|
||||||
public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true);
|
public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(Group.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { Group.GROUP.ID }, true);
|
||||||
public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true);
|
public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { Login.LOGIN.ID }, true);
|
||||||
public static final UniqueKey<LoginRecord> KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { Login.LOGIN.USER_ID }, true);
|
public static final UniqueKey<LoginRecord> KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(Login.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { Login.LOGIN.USER_ID }, true);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import com.databasir.dao.tables.DataSource;
|
||||||
import com.databasir.dao.tables.DataSourceProperty;
|
import com.databasir.dao.tables.DataSourceProperty;
|
||||||
import com.databasir.dao.tables.DatabaseDocument;
|
import com.databasir.dao.tables.DatabaseDocument;
|
||||||
import com.databasir.dao.tables.DatabaseType;
|
import com.databasir.dao.tables.DatabaseType;
|
||||||
import com.databasir.dao.tables.DocumentRemark;
|
import com.databasir.dao.tables.DocumentDiscussion;
|
||||||
import com.databasir.dao.tables.Group;
|
import com.databasir.dao.tables.Group;
|
||||||
import com.databasir.dao.tables.Login;
|
import com.databasir.dao.tables.Login;
|
||||||
import com.databasir.dao.tables.OauthApp;
|
import com.databasir.dao.tables.OauthApp;
|
||||||
|
@ -53,9 +53,9 @@ public class Tables {
|
||||||
public static final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
public static final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table <code>databasir.document_remark</code>.
|
* The table <code>databasir.document_discussion</code>.
|
||||||
*/
|
*/
|
||||||
public static final DocumentRemark DOCUMENT_REMARK = DocumentRemark.DOCUMENT_REMARK;
|
public static final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table <code>databasir.group</code>.
|
* The table <code>databasir.group</code>.
|
||||||
|
|
|
@ -8,15 +8,27 @@ import com.databasir.dao.Databasir;
|
||||||
import com.databasir.dao.Indexes;
|
import com.databasir.dao.Indexes;
|
||||||
import com.databasir.dao.Keys;
|
import com.databasir.dao.Keys;
|
||||||
import com.databasir.dao.tables.records.DatabaseDocumentRecord;
|
import com.databasir.dao.tables.records.DatabaseDocumentRecord;
|
||||||
import org.jooq.*;
|
|
||||||
import org.jooq.impl.DSL;
|
|
||||||
import org.jooq.impl.SQLDataType;
|
|
||||||
import org.jooq.impl.TableImpl;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.jooq.Field;
|
||||||
|
import org.jooq.ForeignKey;
|
||||||
|
import org.jooq.Identity;
|
||||||
|
import org.jooq.Index;
|
||||||
|
import org.jooq.Name;
|
||||||
|
import org.jooq.Record;
|
||||||
|
import org.jooq.Row10;
|
||||||
|
import org.jooq.Schema;
|
||||||
|
import org.jooq.Table;
|
||||||
|
import org.jooq.TableField;
|
||||||
|
import org.jooq.TableOptions;
|
||||||
|
import org.jooq.UniqueKey;
|
||||||
|
import org.jooq.impl.DSL;
|
||||||
|
import org.jooq.impl.SQLDataType;
|
||||||
|
import org.jooq.impl.TableImpl;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is generated by jOOQ.
|
* This class is generated by jOOQ.
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
/*
|
||||||
|
* This file is generated by jOOQ.
|
||||||
|
*/
|
||||||
|
package com.databasir.dao.tables;
|
||||||
|
|
||||||
|
|
||||||
|
import com.databasir.dao.Databasir;
|
||||||
|
import com.databasir.dao.Indexes;
|
||||||
|
import com.databasir.dao.Keys;
|
||||||
|
import com.databasir.dao.tables.records.DocumentDiscussionRecord;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.jooq.Field;
|
||||||
|
import org.jooq.ForeignKey;
|
||||||
|
import org.jooq.Identity;
|
||||||
|
import org.jooq.Index;
|
||||||
|
import org.jooq.Name;
|
||||||
|
import org.jooq.Record;
|
||||||
|
import org.jooq.Row7;
|
||||||
|
import org.jooq.Schema;
|
||||||
|
import org.jooq.Table;
|
||||||
|
import org.jooq.TableField;
|
||||||
|
import org.jooq.TableOptions;
|
||||||
|
import org.jooq.UniqueKey;
|
||||||
|
import org.jooq.impl.DSL;
|
||||||
|
import org.jooq.impl.SQLDataType;
|
||||||
|
import org.jooq.impl.TableImpl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is generated by jOOQ.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||||
|
public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The reference instance of <code>databasir.document_discussion</code>
|
||||||
|
*/
|
||||||
|
public static final DocumentDiscussion DOCUMENT_DISCUSSION = new DocumentDiscussion();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class holding records for this type
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Class<DocumentDiscussionRecord> getRecordType() {
|
||||||
|
return DocumentDiscussionRecord.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.id</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.content</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, String> CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.user_id</code>. user.id
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, Integer> USER_ID = createField(DSL.name("user_id"), SQLDataType.INTEGER.nullable(false), this, "user.id");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.project_id</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, Integer> PROJECT_ID = createField(DSL.name("project_id"), SQLDataType.INTEGER.nullable(false), this, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.table_name</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR(255).nullable(false), this, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.column_name</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, String> COLUMN_NAME = createField(DSL.name("column_name"), SQLDataType.VARCHAR(255), this, "");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column <code>databasir.document_discussion.create_at</code>.
|
||||||
|
*/
|
||||||
|
public final TableField<DocumentDiscussionRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||||
|
|
||||||
|
private DocumentDiscussion(Name alias, Table<DocumentDiscussionRecord> aliased) {
|
||||||
|
this(alias, aliased, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private DocumentDiscussion(Name alias, Table<DocumentDiscussionRecord> aliased, Field<?>[] parameters) {
|
||||||
|
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an aliased <code>databasir.document_discussion</code> table
|
||||||
|
* reference
|
||||||
|
*/
|
||||||
|
public DocumentDiscussion(String alias) {
|
||||||
|
this(DSL.name(alias), DOCUMENT_DISCUSSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an aliased <code>databasir.document_discussion</code> table
|
||||||
|
* reference
|
||||||
|
*/
|
||||||
|
public DocumentDiscussion(Name alias) {
|
||||||
|
this(alias, DOCUMENT_DISCUSSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a <code>databasir.document_discussion</code> table reference
|
||||||
|
*/
|
||||||
|
public DocumentDiscussion() {
|
||||||
|
this(DSL.name("document_discussion"), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <O extends Record> DocumentDiscussion(Table<O> child, ForeignKey<O, DocumentDiscussionRecord> key) {
|
||||||
|
super(child, key, DOCUMENT_DISCUSSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Schema getSchema() {
|
||||||
|
return aliased() ? null : Databasir.DATABASIR;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Index> getIndexes() {
|
||||||
|
return Arrays.asList(Indexes.DOCUMENT_DISCUSSION_IDX_PROJECT_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Identity<DocumentDiscussionRecord, Integer> getIdentity() {
|
||||||
|
return (Identity<DocumentDiscussionRecord, Integer>) super.getIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UniqueKey<DocumentDiscussionRecord> getPrimaryKey() {
|
||||||
|
return Keys.KEY_DOCUMENT_DISCUSSION_PRIMARY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DocumentDiscussion as(String alias) {
|
||||||
|
return new DocumentDiscussion(DSL.name(alias), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DocumentDiscussion as(Name alias) {
|
||||||
|
return new DocumentDiscussion(alias, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rename this table
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DocumentDiscussion rename(String name) {
|
||||||
|
return new DocumentDiscussion(DSL.name(name), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rename this table
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DocumentDiscussion rename(Name name) {
|
||||||
|
return new DocumentDiscussion(name, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
// Row7 type methods
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() {
|
||||||
|
return (Row7) super.fieldsRow();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,176 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is generated by jOOQ.
|
|
||||||
*/
|
|
||||||
package com.databasir.dao.tables;
|
|
||||||
|
|
||||||
|
|
||||||
import com.databasir.dao.Databasir;
|
|
||||||
import com.databasir.dao.Indexes;
|
|
||||||
import com.databasir.dao.Keys;
|
|
||||||
import com.databasir.dao.tables.records.DocumentRemarkRecord;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.jooq.Field;
|
|
||||||
import org.jooq.ForeignKey;
|
|
||||||
import org.jooq.Identity;
|
|
||||||
import org.jooq.Index;
|
|
||||||
import org.jooq.Name;
|
|
||||||
import org.jooq.Record;
|
|
||||||
import org.jooq.Row7;
|
|
||||||
import org.jooq.Schema;
|
|
||||||
import org.jooq.Table;
|
|
||||||
import org.jooq.TableField;
|
|
||||||
import org.jooq.TableOptions;
|
|
||||||
import org.jooq.UniqueKey;
|
|
||||||
import org.jooq.impl.DSL;
|
|
||||||
import org.jooq.impl.SQLDataType;
|
|
||||||
import org.jooq.impl.TableImpl;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class is generated by jOOQ.
|
|
||||||
*/
|
|
||||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
|
||||||
public class DocumentRemark extends TableImpl<DocumentRemarkRecord> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The reference instance of <code>databasir.document_remark</code>
|
|
||||||
*/
|
|
||||||
public static final DocumentRemark DOCUMENT_REMARK = new DocumentRemark();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The class holding records for this type
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Class<DocumentRemarkRecord> getRecordType() {
|
|
||||||
return DocumentRemarkRecord.class;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.id</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, "");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.remark</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, String> REMARK = createField(DSL.name("remark"), SQLDataType.CLOB.nullable(false), this, "");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.user_id</code>. user.id
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, Integer> USER_ID = createField(DSL.name("user_id"), SQLDataType.INTEGER.nullable(false), this, "user.id");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.project_id</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, Integer> PROJECT_ID = createField(DSL.name("project_id"), SQLDataType.INTEGER.nullable(false), this, "");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.table_name</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR(255).nullable(false), this, "");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.column_name</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, String> COLUMN_NAME = createField(DSL.name("column_name"), SQLDataType.VARCHAR(255), this, "");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The column <code>databasir.document_remark.create_at</code>.
|
|
||||||
*/
|
|
||||||
public final TableField<DocumentRemarkRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
|
||||||
|
|
||||||
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased) {
|
|
||||||
this(alias, aliased, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased, Field<?>[] parameters) {
|
|
||||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an aliased <code>databasir.document_remark</code> table reference
|
|
||||||
*/
|
|
||||||
public DocumentRemark(String alias) {
|
|
||||||
this(DSL.name(alias), DOCUMENT_REMARK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create an aliased <code>databasir.document_remark</code> table reference
|
|
||||||
*/
|
|
||||||
public DocumentRemark(Name alias) {
|
|
||||||
this(alias, DOCUMENT_REMARK);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a <code>databasir.document_remark</code> table reference
|
|
||||||
*/
|
|
||||||
public DocumentRemark() {
|
|
||||||
this(DSL.name("document_remark"), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public <O extends Record> DocumentRemark(Table<O> child, ForeignKey<O, DocumentRemarkRecord> key) {
|
|
||||||
super(child, key, DOCUMENT_REMARK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Schema getSchema() {
|
|
||||||
return aliased() ? null : Databasir.DATABASIR;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Index> getIndexes() {
|
|
||||||
return Arrays.asList(Indexes.DOCUMENT_REMARK_IDX_PROJECT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Identity<DocumentRemarkRecord, Integer> getIdentity() {
|
|
||||||
return (Identity<DocumentRemarkRecord, Integer>) super.getIdentity();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UniqueKey<DocumentRemarkRecord> getPrimaryKey() {
|
|
||||||
return Keys.KEY_DOCUMENT_REMARK_PRIMARY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DocumentRemark as(String alias) {
|
|
||||||
return new DocumentRemark(DSL.name(alias), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DocumentRemark as(Name alias) {
|
|
||||||
return new DocumentRemark(alias, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rename this table
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public DocumentRemark rename(String name) {
|
|
||||||
return new DocumentRemark(DSL.name(name), null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rename this table
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public DocumentRemark rename(Name name) {
|
|
||||||
return new DocumentRemark(name, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
// Row7 type methods
|
|
||||||
// -------------------------------------------------------------------------
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() {
|
|
||||||
return (Row7) super.fieldsRow();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,23 +12,23 @@ import java.time.LocalDateTime;
|
||||||
* This class is generated by jOOQ.
|
* This class is generated by jOOQ.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||||
public class DocumentRemarkPojo implements Serializable {
|
public class DocumentDiscussionPojo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String remark;
|
private String content;
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private Integer projectId;
|
private Integer projectId;
|
||||||
private String tableName;
|
private String tableName;
|
||||||
private String columnName;
|
private String columnName;
|
||||||
private LocalDateTime createAt;
|
private LocalDateTime createAt;
|
||||||
|
|
||||||
public DocumentRemarkPojo() {}
|
public DocumentDiscussionPojo() {}
|
||||||
|
|
||||||
public DocumentRemarkPojo(DocumentRemarkPojo value) {
|
public DocumentDiscussionPojo(DocumentDiscussionPojo value) {
|
||||||
this.id = value.id;
|
this.id = value.id;
|
||||||
this.remark = value.remark;
|
this.content = value.content;
|
||||||
this.userId = value.userId;
|
this.userId = value.userId;
|
||||||
this.projectId = value.projectId;
|
this.projectId = value.projectId;
|
||||||
this.tableName = value.tableName;
|
this.tableName = value.tableName;
|
||||||
|
@ -36,9 +36,9 @@ public class DocumentRemarkPojo implements Serializable {
|
||||||
this.createAt = value.createAt;
|
this.createAt = value.createAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DocumentRemarkPojo(
|
public DocumentDiscussionPojo(
|
||||||
Integer id,
|
Integer id,
|
||||||
String remark,
|
String content,
|
||||||
Integer userId,
|
Integer userId,
|
||||||
Integer projectId,
|
Integer projectId,
|
||||||
String tableName,
|
String tableName,
|
||||||
|
@ -46,7 +46,7 @@ public class DocumentRemarkPojo implements Serializable {
|
||||||
LocalDateTime createAt
|
LocalDateTime createAt
|
||||||
) {
|
) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.remark = remark;
|
this.content = content;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.projectId = projectId;
|
this.projectId = projectId;
|
||||||
this.tableName = tableName;
|
this.tableName = tableName;
|
||||||
|
@ -55,98 +55,98 @@ public class DocumentRemarkPojo implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.id</code>.
|
* Getter for <code>databasir.document_discussion.id</code>.
|
||||||
*/
|
*/
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.id</code>.
|
* Setter for <code>databasir.document_discussion.id</code>.
|
||||||
*/
|
*/
|
||||||
public void setId(Integer id) {
|
public void setId(Integer id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.remark</code>.
|
* Getter for <code>databasir.document_discussion.content</code>.
|
||||||
*/
|
*/
|
||||||
public String getRemark() {
|
public String getContent() {
|
||||||
return this.remark;
|
return this.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.remark</code>.
|
* Setter for <code>databasir.document_discussion.content</code>.
|
||||||
*/
|
*/
|
||||||
public void setRemark(String remark) {
|
public void setContent(String content) {
|
||||||
this.remark = remark;
|
this.content = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.user_id</code>. user.id
|
* Getter for <code>databasir.document_discussion.user_id</code>. user.id
|
||||||
*/
|
*/
|
||||||
public Integer getUserId() {
|
public Integer getUserId() {
|
||||||
return this.userId;
|
return this.userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.user_id</code>. user.id
|
* Setter for <code>databasir.document_discussion.user_id</code>. user.id
|
||||||
*/
|
*/
|
||||||
public void setUserId(Integer userId) {
|
public void setUserId(Integer userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.project_id</code>.
|
* Getter for <code>databasir.document_discussion.project_id</code>.
|
||||||
*/
|
*/
|
||||||
public Integer getProjectId() {
|
public Integer getProjectId() {
|
||||||
return this.projectId;
|
return this.projectId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.project_id</code>.
|
* Setter for <code>databasir.document_discussion.project_id</code>.
|
||||||
*/
|
*/
|
||||||
public void setProjectId(Integer projectId) {
|
public void setProjectId(Integer projectId) {
|
||||||
this.projectId = projectId;
|
this.projectId = projectId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.table_name</code>.
|
* Getter for <code>databasir.document_discussion.table_name</code>.
|
||||||
*/
|
*/
|
||||||
public String getTableName() {
|
public String getTableName() {
|
||||||
return this.tableName;
|
return this.tableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.table_name</code>.
|
* Setter for <code>databasir.document_discussion.table_name</code>.
|
||||||
*/
|
*/
|
||||||
public void setTableName(String tableName) {
|
public void setTableName(String tableName) {
|
||||||
this.tableName = tableName;
|
this.tableName = tableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.column_name</code>.
|
* Getter for <code>databasir.document_discussion.column_name</code>.
|
||||||
*/
|
*/
|
||||||
public String getColumnName() {
|
public String getColumnName() {
|
||||||
return this.columnName;
|
return this.columnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.column_name</code>.
|
* Setter for <code>databasir.document_discussion.column_name</code>.
|
||||||
*/
|
*/
|
||||||
public void setColumnName(String columnName) {
|
public void setColumnName(String columnName) {
|
||||||
this.columnName = columnName;
|
this.columnName = columnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.create_at</code>.
|
* Getter for <code>databasir.document_discussion.create_at</code>.
|
||||||
*/
|
*/
|
||||||
public LocalDateTime getCreateAt() {
|
public LocalDateTime getCreateAt() {
|
||||||
return this.createAt;
|
return this.createAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.create_at</code>.
|
* Setter for <code>databasir.document_discussion.create_at</code>.
|
||||||
*/
|
*/
|
||||||
public void setCreateAt(LocalDateTime createAt) {
|
public void setCreateAt(LocalDateTime createAt) {
|
||||||
this.createAt = createAt;
|
this.createAt = createAt;
|
||||||
|
@ -154,10 +154,10 @@ public class DocumentRemarkPojo implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder("DocumentRemarkPojo (");
|
StringBuilder sb = new StringBuilder("DocumentDiscussionPojo (");
|
||||||
|
|
||||||
sb.append(id);
|
sb.append(id);
|
||||||
sb.append(", ").append(remark);
|
sb.append(", ").append(content);
|
||||||
sb.append(", ").append(userId);
|
sb.append(", ").append(userId);
|
||||||
sb.append(", ").append(projectId);
|
sb.append(", ").append(projectId);
|
||||||
sb.append(", ").append(tableName);
|
sb.append(", ").append(tableName);
|
|
@ -4,8 +4,8 @@
|
||||||
package com.databasir.dao.tables.records;
|
package com.databasir.dao.tables.records;
|
||||||
|
|
||||||
|
|
||||||
import com.databasir.dao.tables.DocumentRemark;
|
import com.databasir.dao.tables.DocumentDiscussion;
|
||||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@ -20,103 +20,103 @@ import org.jooq.impl.UpdatableRecordImpl;
|
||||||
* This class is generated by jOOQ.
|
* This class is generated by jOOQ.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||||
public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkRecord> implements Record7<Integer, String, Integer, Integer, String, String, LocalDateTime> {
|
public class DocumentDiscussionRecord extends UpdatableRecordImpl<DocumentDiscussionRecord> implements Record7<Integer, String, Integer, Integer, String, String, LocalDateTime> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.id</code>.
|
* Setter for <code>databasir.document_discussion.id</code>.
|
||||||
*/
|
*/
|
||||||
public void setId(Integer value) {
|
public void setId(Integer value) {
|
||||||
set(0, value);
|
set(0, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.id</code>.
|
* Getter for <code>databasir.document_discussion.id</code>.
|
||||||
*/
|
*/
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return (Integer) get(0);
|
return (Integer) get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.remark</code>.
|
* Setter for <code>databasir.document_discussion.content</code>.
|
||||||
*/
|
*/
|
||||||
public void setRemark(String value) {
|
public void setContent(String value) {
|
||||||
set(1, value);
|
set(1, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.remark</code>.
|
* Getter for <code>databasir.document_discussion.content</code>.
|
||||||
*/
|
*/
|
||||||
public String getRemark() {
|
public String getContent() {
|
||||||
return (String) get(1);
|
return (String) get(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.user_id</code>. user.id
|
* Setter for <code>databasir.document_discussion.user_id</code>. user.id
|
||||||
*/
|
*/
|
||||||
public void setUserId(Integer value) {
|
public void setUserId(Integer value) {
|
||||||
set(2, value);
|
set(2, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.user_id</code>. user.id
|
* Getter for <code>databasir.document_discussion.user_id</code>. user.id
|
||||||
*/
|
*/
|
||||||
public Integer getUserId() {
|
public Integer getUserId() {
|
||||||
return (Integer) get(2);
|
return (Integer) get(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.project_id</code>.
|
* Setter for <code>databasir.document_discussion.project_id</code>.
|
||||||
*/
|
*/
|
||||||
public void setProjectId(Integer value) {
|
public void setProjectId(Integer value) {
|
||||||
set(3, value);
|
set(3, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.project_id</code>.
|
* Getter for <code>databasir.document_discussion.project_id</code>.
|
||||||
*/
|
*/
|
||||||
public Integer getProjectId() {
|
public Integer getProjectId() {
|
||||||
return (Integer) get(3);
|
return (Integer) get(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.table_name</code>.
|
* Setter for <code>databasir.document_discussion.table_name</code>.
|
||||||
*/
|
*/
|
||||||
public void setTableName(String value) {
|
public void setTableName(String value) {
|
||||||
set(4, value);
|
set(4, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.table_name</code>.
|
* Getter for <code>databasir.document_discussion.table_name</code>.
|
||||||
*/
|
*/
|
||||||
public String getTableName() {
|
public String getTableName() {
|
||||||
return (String) get(4);
|
return (String) get(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.column_name</code>.
|
* Setter for <code>databasir.document_discussion.column_name</code>.
|
||||||
*/
|
*/
|
||||||
public void setColumnName(String value) {
|
public void setColumnName(String value) {
|
||||||
set(5, value);
|
set(5, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.column_name</code>.
|
* Getter for <code>databasir.document_discussion.column_name</code>.
|
||||||
*/
|
*/
|
||||||
public String getColumnName() {
|
public String getColumnName() {
|
||||||
return (String) get(5);
|
return (String) get(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for <code>databasir.document_remark.create_at</code>.
|
* Setter for <code>databasir.document_discussion.create_at</code>.
|
||||||
*/
|
*/
|
||||||
public void setCreateAt(LocalDateTime value) {
|
public void setCreateAt(LocalDateTime value) {
|
||||||
set(6, value);
|
set(6, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for <code>databasir.document_remark.create_at</code>.
|
* Getter for <code>databasir.document_discussion.create_at</code>.
|
||||||
*/
|
*/
|
||||||
public LocalDateTime getCreateAt() {
|
public LocalDateTime getCreateAt() {
|
||||||
return (LocalDateTime) get(6);
|
return (LocalDateTime) get(6);
|
||||||
|
@ -147,37 +147,37 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<Integer> field1() {
|
public Field<Integer> field1() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.ID;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<String> field2() {
|
public Field<String> field2() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.REMARK;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.CONTENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<Integer> field3() {
|
public Field<Integer> field3() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.USER_ID;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.USER_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<Integer> field4() {
|
public Field<Integer> field4() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.PROJECT_ID;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.PROJECT_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<String> field5() {
|
public Field<String> field5() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.TABLE_NAME;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.TABLE_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<String> field6() {
|
public Field<String> field6() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.COLUMN_NAME;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.COLUMN_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Field<LocalDateTime> field7() {
|
public Field<LocalDateTime> field7() {
|
||||||
return DocumentRemark.DOCUMENT_REMARK.CREATE_AT;
|
return DocumentDiscussion.DOCUMENT_DISCUSSION.CREATE_AT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -187,7 +187,7 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String component2() {
|
public String component2() {
|
||||||
return getRemark();
|
return getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -222,7 +222,7 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String value2() {
|
public String value2() {
|
||||||
return getRemark();
|
return getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -251,49 +251,49 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value1(Integer value) {
|
public DocumentDiscussionRecord value1(Integer value) {
|
||||||
setId(value);
|
setId(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value2(String value) {
|
public DocumentDiscussionRecord value2(String value) {
|
||||||
setRemark(value);
|
setContent(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value3(Integer value) {
|
public DocumentDiscussionRecord value3(Integer value) {
|
||||||
setUserId(value);
|
setUserId(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value4(Integer value) {
|
public DocumentDiscussionRecord value4(Integer value) {
|
||||||
setProjectId(value);
|
setProjectId(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value5(String value) {
|
public DocumentDiscussionRecord value5(String value) {
|
||||||
setTableName(value);
|
setTableName(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value6(String value) {
|
public DocumentDiscussionRecord value6(String value) {
|
||||||
setColumnName(value);
|
setColumnName(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord value7(LocalDateTime value) {
|
public DocumentDiscussionRecord value7(LocalDateTime value) {
|
||||||
setCreateAt(value);
|
setCreateAt(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentRemarkRecord values(Integer value1, String value2, Integer value3, Integer value4, String value5, String value6, LocalDateTime value7) {
|
public DocumentDiscussionRecord values(Integer value1, String value2, Integer value3, Integer value4, String value5, String value6, LocalDateTime value7) {
|
||||||
value1(value1);
|
value1(value1);
|
||||||
value2(value2);
|
value2(value2);
|
||||||
value3(value3);
|
value3(value3);
|
||||||
|
@ -309,20 +309,20 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a detached DocumentRemarkRecord
|
* Create a detached DocumentDiscussionRecord
|
||||||
*/
|
*/
|
||||||
public DocumentRemarkRecord() {
|
public DocumentDiscussionRecord() {
|
||||||
super(DocumentRemark.DOCUMENT_REMARK);
|
super(DocumentDiscussion.DOCUMENT_DISCUSSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a detached, initialised DocumentRemarkRecord
|
* Create a detached, initialised DocumentDiscussionRecord
|
||||||
*/
|
*/
|
||||||
public DocumentRemarkRecord(Integer id, String remark, Integer userId, Integer projectId, String tableName, String columnName, LocalDateTime createAt) {
|
public DocumentDiscussionRecord(Integer id, String content, Integer userId, Integer projectId, String tableName, String columnName, LocalDateTime createAt) {
|
||||||
super(DocumentRemark.DOCUMENT_REMARK);
|
super(DocumentDiscussion.DOCUMENT_DISCUSSION);
|
||||||
|
|
||||||
setId(id);
|
setId(id);
|
||||||
setRemark(remark);
|
setContent(content);
|
||||||
setUserId(userId);
|
setUserId(userId);
|
||||||
setProjectId(projectId);
|
setProjectId(projectId);
|
||||||
setTableName(tableName);
|
setTableName(tableName);
|
||||||
|
@ -331,14 +331,14 @@ public class DocumentRemarkRecord extends UpdatableRecordImpl<DocumentRemarkReco
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a detached, initialised DocumentRemarkRecord
|
* Create a detached, initialised DocumentDiscussionRecord
|
||||||
*/
|
*/
|
||||||
public DocumentRemarkRecord(DocumentRemarkPojo value) {
|
public DocumentDiscussionRecord(DocumentDiscussionPojo value) {
|
||||||
super(DocumentRemark.DOCUMENT_REMARK);
|
super(DocumentDiscussion.DOCUMENT_DISCUSSION);
|
||||||
|
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
setId(value.getId());
|
setId(value.getId());
|
||||||
setRemark(value.getRemark());
|
setContent(value.getContent());
|
||||||
setUserId(value.getUserId());
|
setUserId(value.getUserId());
|
||||||
setProjectId(value.getProjectId());
|
setProjectId(value.getProjectId());
|
||||||
setTableName(value.getTableName());
|
setTableName(value.getTableName());
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.databasir.dao.impl;
|
||||||
|
|
||||||
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||||
|
import com.databasir.dao.value.DocumentDiscussionCountPojo;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.jooq.Condition;
|
||||||
|
import org.jooq.DSLContext;
|
||||||
|
import org.jooq.impl.DSL;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static com.databasir.dao.Tables.DOCUMENT_DISCUSSION;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class DocumentDiscussionDao extends BaseDao<DocumentDiscussionPojo> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Getter
|
||||||
|
private DSLContext dslContext;
|
||||||
|
|
||||||
|
public DocumentDiscussionDao() {
|
||||||
|
super(DOCUMENT_DISCUSSION, DocumentDiscussionPojo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Optional<DocumentDiscussionPojo> selectByProjectIdAndId(Integer projectId, Integer id) {
|
||||||
|
return this.getDslContext()
|
||||||
|
.selectFrom(DOCUMENT_DISCUSSION).where(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId)
|
||||||
|
.and(DOCUMENT_DISCUSSION.ID.eq(id)))
|
||||||
|
.fetchOptionalInto(DocumentDiscussionPojo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DocumentDiscussionCountPojo> selectTableDiscussionCount(Integer projectId) {
|
||||||
|
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId)
|
||||||
|
.and(DOCUMENT_DISCUSSION.COLUMN_NAME.isNull()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DocumentDiscussionCountPojo> selectAllDiscussionCount(Integer projectId) {
|
||||||
|
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DocumentDiscussionCountPojo> selectDiscussionCount(Condition condition) {
|
||||||
|
return this.getDslContext()
|
||||||
|
.select(DSL.count(), DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME)
|
||||||
|
.from(DOCUMENT_DISCUSSION)
|
||||||
|
.where(condition)
|
||||||
|
.groupBy(DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME)
|
||||||
|
.fetchInto(DocumentDiscussionCountPojo.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package com.databasir.dao.impl;
|
|
||||||
|
|
||||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo;
|
|
||||||
import lombok.Getter;
|
|
||||||
import org.jooq.DSLContext;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import static com.databasir.dao.Tables.DOCUMENT_REMARK;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class DocumentRemarkDao extends BaseDao<DocumentRemarkPojo> {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
@Getter
|
|
||||||
private DSLContext dslContext;
|
|
||||||
|
|
||||||
public DocumentRemarkDao() {
|
|
||||||
super(DOCUMENT_REMARK, DocumentRemarkPojo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Optional<DocumentRemarkPojo> selectByProjectIdAndId(Integer projectId, Integer id) {
|
|
||||||
return this.getDslContext()
|
|
||||||
.selectFrom(DOCUMENT_REMARK).where(DOCUMENT_REMARK.PROJECT_ID.eq(projectId)
|
|
||||||
.and(DOCUMENT_REMARK.ID.eq(id)))
|
|
||||||
.fetchOptionalInto(DocumentRemarkPojo.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.databasir.dao.value;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DocumentDiscussionCountPojo {
|
||||||
|
|
||||||
|
private Integer projectId;
|
||||||
|
|
||||||
|
private String tableName;
|
||||||
|
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
private Integer count;
|
||||||
|
}
|
|
@ -211,10 +211,10 @@ CREATE TABLE IF NOT EXISTS login
|
||||||
) CHARSET utf8mb4
|
) CHARSET utf8mb4
|
||||||
COLLATE utf8mb4_unicode_ci;
|
COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS document_remark
|
CREATE TABLE IF NOT EXISTS document_discussion
|
||||||
(
|
(
|
||||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
remark TEXT NOT NULL,
|
content TEXT NOT NULL,
|
||||||
user_id INT NOT NULL COMMENT 'user.id',
|
user_id INT NOT NULL COMMENT 'user.id',
|
||||||
project_id INT NOT NULL,
|
project_id INT NOT NULL,
|
||||||
table_name VARCHAR(255) NOT NULL,
|
table_name VARCHAR(255) NOT NULL,
|
||||||
|
|
|
@ -15,6 +15,7 @@ public class TableCondition extends Condition {
|
||||||
return TableCondition.builder()
|
return TableCondition.builder()
|
||||||
.databaseName(condition.getDatabaseName())
|
.databaseName(condition.getDatabaseName())
|
||||||
.tableName(tableName)
|
.tableName(tableName)
|
||||||
|
.schemaName(condition.getSchemaName())
|
||||||
.ignoreTableNameRegex(condition.getIgnoreTableNameRegex())
|
.ignoreTableNameRegex(condition.getIgnoreTableNameRegex())
|
||||||
.ignoreTableColumnNameRegex(condition.getIgnoreTableColumnNameRegex())
|
.ignoreTableColumnNameRegex(condition.getIgnoreTableColumnNameRegex())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -30,10 +30,11 @@ public class JdbcColumnMetaRepository implements ColumnMetaRepository {
|
||||||
List<ColumnMeta> columnDocs = new ArrayList<>();
|
List<ColumnMeta> columnDocs = new ArrayList<>();
|
||||||
String databaseName = tableCondition.getDatabaseName();
|
String databaseName = tableCondition.getDatabaseName();
|
||||||
String tableName = tableCondition.getTableName();
|
String tableName = tableCondition.getTableName();
|
||||||
List<String> primaryKeyColumns = selectPrimaryKeyColumns(connection.getMetaData(), databaseName, tableName);
|
List<String> primaryKeyColumns = selectPrimaryKeyColumns(connection.getMetaData(), tableCondition);
|
||||||
ResultSet columnsResult;
|
ResultSet columnsResult;
|
||||||
try {
|
try {
|
||||||
columnsResult = connection.getMetaData().getColumns(databaseName, null, tableName, null);
|
columnsResult = connection.getMetaData()
|
||||||
|
.getColumns(databaseName, tableCondition.getSchemaName(), tableName, null);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.warn("warn: ignore columns in " + databaseName + "." + tableName);
|
log.warn("warn: ignore columns in " + databaseName + "." + tableName);
|
||||||
return columnDocs;
|
return columnDocs;
|
||||||
|
@ -85,9 +86,9 @@ public class JdbcColumnMetaRepository implements ColumnMetaRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> selectPrimaryKeyColumns(DatabaseMetaData meta,
|
private List<String> selectPrimaryKeyColumns(DatabaseMetaData meta,
|
||||||
String catalog,
|
TableCondition tableCondition) throws SQLException {
|
||||||
String tableName) throws SQLException {
|
ResultSet result = meta.getPrimaryKeys(tableCondition.getDatabaseName(),
|
||||||
ResultSet result = meta.getPrimaryKeys(catalog, null, tableName);
|
tableCondition.getSchemaName(), tableCondition.getTableName());
|
||||||
List<String> columns = new ArrayList<>();
|
List<String> columns = new ArrayList<>();
|
||||||
while (result.next()) {
|
while (result.next()) {
|
||||||
String columnName = result.getString("COLUMN_NAME");
|
String columnName = result.getString("COLUMN_NAME");
|
||||||
|
|
|
@ -28,7 +28,8 @@ public class JdbcIndexMetaRepository implements IndexMetaRepository {
|
||||||
List<IndexMeta> indexMetas = new ArrayList<>();
|
List<IndexMeta> indexMetas = new ArrayList<>();
|
||||||
ResultSet indexResults;
|
ResultSet indexResults;
|
||||||
try {
|
try {
|
||||||
indexResults = connection.getMetaData().getIndexInfo(databaseName, null, tableName, false, false);
|
indexResults = connection.getMetaData()
|
||||||
|
.getIndexInfo(databaseName, condition.getSchemaName(), tableName, false, false);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.warn("warn: ignore " + databaseName + "." + tableName);
|
log.warn("warn: ignore " + databaseName + "." + tableName);
|
||||||
return indexMetas;
|
return indexMetas;
|
||||||
|
|
Loading…
Reference in New Issue