refactor: rename pojo class name
This commit is contained in:
parent
a003316f56
commit
8948745321
|
@ -39,7 +39,7 @@ public class DocumentDescriptionController {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = principal.getUserPojo().getId();
|
||||
Integer userId = principal.getUser().getId();
|
||||
documentDescriptionService.save(groupId, projectId, userId, request);
|
||||
return JsonData.ok();
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class DocumentDiscussionController {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = principal.getUserPojo().getId();
|
||||
Integer userId = principal.getUser().getId();
|
||||
documentDiscussionService.create(groupId, projectId, userId, request);
|
||||
return JsonData.ok();
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class LoginController {
|
|||
DatabasirUserDetails user = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = user.getUserPojo().getId();
|
||||
Integer userId = user.getUser().getId();
|
||||
return JsonData.ok(loginService.getUserLoginData(userId));
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ public class ProjectController {
|
|||
DatabasirUserDetails user = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = user.getUserPojo().getId();
|
||||
Integer userId = user.getUser().getId();
|
||||
return JsonData.ok(projectService.list(userId, page, condition));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class UserProjectController {
|
|||
DatabasirUserDetails user = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = user.getUserPojo().getId();
|
||||
Integer userId = user.getUser().getId();
|
||||
return JsonData.ok(userProjectService.listFavorites(pageable, userId, condition));
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class UserProjectController {
|
|||
DatabasirUserDetails user = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = user.getUserPojo().getId();
|
||||
Integer userId = user.getUser().getId();
|
||||
userProjectService.addFavorites(projectId, userId);
|
||||
return JsonData.ok();
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class UserProjectController {
|
|||
DatabasirUserDetails user = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
Integer userId = user.getUserPojo().getId();
|
||||
Integer userId = user.getUser().getId();
|
||||
userProjectService.removeFavorites(projectId, userId);
|
||||
return JsonData.ok();
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.databasir.core.domain.log.annotation.AuditLog;
|
|||
import com.databasir.core.domain.log.data.OperationLogRequest;
|
||||
import com.databasir.core.domain.log.service.OperationLogService;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
|
@ -75,12 +75,12 @@ public class OperationLogAspect {
|
|||
&& operation.retrieveInvolvedGroupId()
|
||||
&& involvedProjectId != null) {
|
||||
involvedGroupId = projectDao.selectOptionalById(involvedProjectId)
|
||||
.map(ProjectPojo::getGroupId)
|
||||
.map(Project::getGroupId)
|
||||
.orElse(null);
|
||||
}
|
||||
int userId = userId();
|
||||
String username = principal.getUserPojo().getUsername();
|
||||
String nickname = principal.getUserPojo().getNickname();
|
||||
String username = principal.getUser().getUsername();
|
||||
String nickname = principal.getUser().getNickname();
|
||||
if (userId == AuditLog.Types.SYSTEM_USER_ID) {
|
||||
username = "system";
|
||||
nickname = "system";
|
||||
|
@ -105,7 +105,7 @@ public class OperationLogAspect {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
return principal.getUserPojo().getId();
|
||||
return principal.getUser().getId();
|
||||
}
|
||||
|
||||
private <T> Optional<T> getValueBySPEL(Method method,
|
||||
|
|
|
@ -9,6 +9,6 @@ public class LoginUserContext {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
return principal.getUserPojo().getId();
|
||||
return principal.getUser().getId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,16 +36,16 @@ public class OAuth2AuthenticationSuccessHandler implements AuthenticationSuccess
|
|||
HttpServletResponse response,
|
||||
Authentication authentication) throws IOException, ServletException {
|
||||
DatabasirUserDetails details = (DatabasirUserDetails) authentication.getPrincipal();
|
||||
loginService.generate(details.getUserPojo().getId());
|
||||
UserLoginResponse data = loginService.getUserLoginData(details.getUserPojo().getId())
|
||||
loginService.generate(details.getUser().getId());
|
||||
UserLoginResponse data = loginService.getUserLoginData(details.getUser().getId())
|
||||
.orElseThrow(() -> {
|
||||
operationLogService.saveLoginLog(details.getUserPojo(), false, null);
|
||||
operationLogService.saveLoginLog(details.getUser(), false, null);
|
||||
return new CredentialsExpiredException("请重新登陆");
|
||||
});
|
||||
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
|
||||
objectMapper.writeValue(response.getWriter(), JsonData.ok(data));
|
||||
operationLogService.saveLoginLog(details.getUserPojo(), true, null);
|
||||
operationLogService.saveLoginLog(details.getUser(), true, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ public class DatabasirAuthenticationSuccessHandler implements AuthenticationSucc
|
|||
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
|
||||
|
||||
loginService.generate(user.getUserPojo().getId());
|
||||
UserLoginResponse data = loginService.getUserLoginData(user.getUserPojo().getId())
|
||||
loginService.generate(user.getUser().getId());
|
||||
UserLoginResponse data = loginService.getUserLoginData(user.getUser().getId())
|
||||
.orElseThrow(() -> {
|
||||
operationLogService.saveLoginLog(user.getUserPojo(), false, null);
|
||||
operationLogService.saveLoginLog(user.getUser(), false, null);
|
||||
return new CredentialsExpiredException("请重新登陆");
|
||||
});
|
||||
operationLogService.saveLoginLog(user.getUserPojo(), true, null);
|
||||
operationLogService.saveLoginLog(user.getUser(), true, null);
|
||||
objectMapper.writeValue(response.getWriter(), JsonData.ok(data));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.databasir.api.config.security;
|
|||
import com.databasir.core.domain.log.service.OperationLogService;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
@ -28,12 +28,12 @@ public class DatabasirUserDetailService implements UserDetailsService {
|
|||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
UserPojo user = userDao.selectByEmailOrUsername(username)
|
||||
User user = userDao.selectByEmailOrUsername(username)
|
||||
.orElseThrow(() -> {
|
||||
operationLogService.saveLoginFailedLog(username, "用户名不存在");
|
||||
return new UsernameNotFoundException("用户名或密码错误");
|
||||
});
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(Collections.singletonList(user.getId()));
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(Collections.singletonList(user.getId()));
|
||||
return new DatabasirUserDetails(user, roles);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.api.config.security;
|
||||
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
@ -16,10 +16,10 @@ import java.util.stream.Collectors;
|
|||
public class DatabasirUserDetails implements UserDetails {
|
||||
|
||||
@Getter
|
||||
private final UserPojo userPojo;
|
||||
private final User user;
|
||||
|
||||
@Getter
|
||||
private final List<UserRolePojo> roles;
|
||||
private final List<UserRole> roles;
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
|
@ -36,12 +36,12 @@ public class DatabasirUserDetails implements UserDetails {
|
|||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return userPojo.getPassword();
|
||||
return user.getPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return userPojo.getEmail();
|
||||
return user.getEmail();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,6 +61,6 @@ public class DatabasirUserDetails implements UserDetails {
|
|||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return userPojo.getEnabled();
|
||||
return user.getEnabled();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class UserOperationValidator {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
if (principal.getUserPojo().getId().equals(userId)) {
|
||||
if (principal.getUser().getId().equals(userId)) {
|
||||
throw DomainErrors.CANNOT_UPDATE_SELF_ROLE.exception();
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public class UserOperationValidator {
|
|||
DatabasirUserDetails principal = (DatabasirUserDetails) SecurityContextHolder.getContext()
|
||||
.getAuthentication()
|
||||
.getPrincipal();
|
||||
return principal.getUserPojo().getId().equals(userId);
|
||||
return principal.getUser().getId().equals(userId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.databasir.job;
|
|||
|
||||
import com.databasir.core.domain.document.service.DocumentService;
|
||||
import com.databasir.dao.impl.ProjectSyncRuleDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRulePojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRule;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.*;
|
||||
|
@ -135,7 +135,7 @@ public class ProjectSyncJobScheduler {
|
|||
}
|
||||
}
|
||||
|
||||
private Pair<JobDetail, Trigger> jobAndTriggers(ProjectSyncRulePojo rule) {
|
||||
private Pair<JobDetail, Trigger> jobAndTriggers(ProjectSyncRule rule) {
|
||||
JobDataMap dataMap = new JobDataMap();
|
||||
Integer projectId = rule.getProjectId();
|
||||
Integer ruleId = rule.getId();
|
||||
|
|
|
@ -8,8 +8,8 @@ import com.databasir.dao.enums.ProjectSyncTaskStatus;
|
|||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.ProjectSyncTaskDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncTaskPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncTask;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
@ -44,9 +44,9 @@ public class ProjectSyncTaskScheduler {
|
|||
@Scheduled(fixedRate = 5000L)
|
||||
public void startSyncTask() {
|
||||
final int size = 10;
|
||||
List<ProjectSyncTaskPojo> tasks = projectSyncTaskDao.listNewTasks(size);
|
||||
List<ProjectSyncTask> tasks = projectSyncTaskDao.listNewTasks(size);
|
||||
List<Integer> projectIds = tasks.stream()
|
||||
.map(ProjectSyncTaskPojo::getProjectId)
|
||||
.map(ProjectSyncTask::getProjectId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, Integer> groupIdAndProjectIdMap = projectDao.selectGroupIdsByProjectIdIn(projectIds);
|
||||
|
@ -88,7 +88,7 @@ public class ProjectSyncTaskScheduler {
|
|||
operatorUsername = "system";
|
||||
operationName = "定时同步";
|
||||
} else {
|
||||
UserPojo user = userDao.selectById(userId);
|
||||
User user = userDao.selectById(userId);
|
||||
operatorNickName = user.getNickname();
|
||||
operatorUsername = user.getUsername();
|
||||
operationName = "手动同步";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.app;
|
||||
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.domain.app.converter.OAuthAppPojoConverter;
|
||||
import com.databasir.core.domain.app.converter.OauthAppConverter;
|
||||
import com.databasir.core.domain.app.converter.OAuthAppResponseConverter;
|
||||
import com.databasir.core.domain.app.data.*;
|
||||
import com.databasir.core.domain.app.handler.OAuthProcessResult;
|
||||
|
@ -10,7 +10,7 @@ import com.databasir.core.domain.user.data.UserCreateRequest;
|
|||
import com.databasir.core.domain.user.data.UserDetailResponse;
|
||||
import com.databasir.core.domain.user.service.UserService;
|
||||
import com.databasir.dao.impl.OauthAppDao;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
@ -35,7 +35,7 @@ public class OpenAuthAppService {
|
|||
|
||||
private final OAuthAppResponseConverter oauthAppResponseConverter;
|
||||
|
||||
private final OAuthAppPojoConverter oauthAppPojoConverter;
|
||||
private final OauthAppConverter oauthAppConverter;
|
||||
|
||||
public UserDetailResponse oauthCallback(String registrationId, Map<String, String[]> params) {
|
||||
// process by handler
|
||||
|
@ -57,7 +57,7 @@ public class OpenAuthAppService {
|
|||
}
|
||||
|
||||
public List<OAuthAppResponse> listAll() {
|
||||
List<OauthAppPojo> apps = oauthAppDao.selectAll();
|
||||
List<OauthApp> apps = oauthAppDao.selectAll();
|
||||
return apps.stream()
|
||||
.map(oauthAppResponseConverter::to)
|
||||
.collect(Collectors.toList());
|
||||
|
@ -70,7 +70,7 @@ public class OpenAuthAppService {
|
|||
}
|
||||
|
||||
public void updateById(OAuthAppUpdateRequest request) {
|
||||
OauthAppPojo pojo = oauthAppPojoConverter.of(request);
|
||||
OauthApp pojo = oauthAppConverter.of(request);
|
||||
try {
|
||||
oauthAppDao.updateById(pojo);
|
||||
} catch (DuplicateKeyException e) {
|
||||
|
@ -79,7 +79,7 @@ public class OpenAuthAppService {
|
|||
}
|
||||
|
||||
public Integer create(OAuthAppCreateRequest request) {
|
||||
OauthAppPojo pojo = oauthAppPojoConverter.of(request);
|
||||
OauthApp pojo = oauthAppConverter.of(request);
|
||||
try {
|
||||
return oauthAppDao.insertAndReturnId(pojo);
|
||||
} catch (DuplicateKeyException e) {
|
||||
|
@ -88,10 +88,10 @@ public class OpenAuthAppService {
|
|||
}
|
||||
|
||||
public Page<OAuthAppPageResponse> listPage(Pageable page, OAuthAppPageCondition condition) {
|
||||
return oauthAppDao.selectByPage(page, condition.toCondition()).map(oauthAppPojoConverter::toPageResponse);
|
||||
return oauthAppDao.selectByPage(page, condition.toCondition()).map(oauthAppConverter::toPageResponse);
|
||||
}
|
||||
|
||||
public Optional<OAuthAppDetailResponse> getOne(Integer id) {
|
||||
return oauthAppDao.selectOptionalById(id).map(oauthAppPojoConverter::toDetailResponse);
|
||||
return oauthAppDao.selectOptionalById(id).map(oauthAppConverter::toDetailResponse);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.databasir.core.domain.app.converter;
|
||||
|
||||
import com.databasir.core.domain.app.data.OAuthAppResponse;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface OAuthAppResponseConverter {
|
||||
|
||||
OAuthAppResponse to(OauthAppPojo pojo);
|
||||
OAuthAppResponse to(OauthApp pojo);
|
||||
}
|
||||
|
|
|
@ -4,23 +4,23 @@ import com.databasir.core.domain.app.data.OAuthAppCreateRequest;
|
|||
import com.databasir.core.domain.app.data.OAuthAppDetailResponse;
|
||||
import com.databasir.core.domain.app.data.OAuthAppPageResponse;
|
||||
import com.databasir.core.domain.app.data.OAuthAppUpdateRequest;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface OAuthAppPojoConverter {
|
||||
public interface OauthAppConverter {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
OauthAppPojo of(OAuthAppCreateRequest request);
|
||||
OauthApp of(OAuthAppCreateRequest request);
|
||||
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
OauthAppPojo of(OAuthAppUpdateRequest request);
|
||||
OauthApp of(OAuthAppUpdateRequest request);
|
||||
|
||||
OAuthAppPageResponse toPageResponse(OauthAppPojo pojo);
|
||||
OAuthAppPageResponse toPageResponse(OauthApp pojo);
|
||||
|
||||
OAuthAppDetailResponse toDetailResponse(OauthAppPojo pojo);
|
||||
OAuthAppDetailResponse toDetailResponse(OauthApp pojo);
|
||||
}
|
|
@ -4,7 +4,7 @@ import com.databasir.core.domain.DomainErrors;
|
|||
import com.databasir.core.domain.app.exception.DatabasirAuthenticationException;
|
||||
import com.databasir.core.infrastructure.remote.github.GithubRemoteService;
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.jooq.tools.StringUtils;
|
||||
|
@ -26,7 +26,7 @@ public class GithubOpenAuthHandler implements OpenAuthHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String authorizationUrl(OauthAppPojo app, Map<String, String[]> requestParams) {
|
||||
public String authorizationUrl(OauthApp app, Map<String, String[]> requestParams) {
|
||||
String authUrl = app.getAuthUrl();
|
||||
String clientId = app.getClientId();
|
||||
String authorizeUrl = authUrl + "/login/oauth/authorize";
|
||||
|
@ -40,7 +40,7 @@ public class GithubOpenAuthHandler implements OpenAuthHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public OAuthProcessResult process(OauthAppPojo app, Map<String, String[]> requestParams) {
|
||||
public OAuthProcessResult process(OauthApp app, Map<String, String[]> requestParams) {
|
||||
String clientId = app.getClientId();
|
||||
String clientSecret = app.getClientSecret();
|
||||
String authUrl = app.getAuthUrl();
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.databasir.core.domain.DomainErrors;
|
|||
import com.databasir.core.domain.app.exception.DatabasirAuthenticationException;
|
||||
import com.databasir.core.infrastructure.remote.gitlab.GitlabRemoteService;
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -24,7 +24,7 @@ public class GitlabOpenAuthHandler implements OpenAuthHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String authorizationUrl(OauthAppPojo app, Map<String, String[]> params) {
|
||||
public String authorizationUrl(OauthApp app, Map<String, String[]> params) {
|
||||
if (!params.containsKey("redirect_uri")) {
|
||||
throw DomainErrors.MISS_REQUIRED_PARAMETERS.exception("缺少参数 redirect_uri", null);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class GitlabOpenAuthHandler implements OpenAuthHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public OAuthProcessResult process(OauthAppPojo app, Map<String, String[]> requestParams) {
|
||||
public OAuthProcessResult process(OauthApp app, Map<String, String[]> requestParams) {
|
||||
if (!requestParams.containsKey("redirect_uri")) {
|
||||
throw DomainErrors.MISS_REQUIRED_PARAMETERS.exception("缺少参数 redirect_uri", null);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.databasir.core.domain.app.handler;
|
||||
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -17,7 +17,7 @@ public class OAuthProcessContext {
|
|||
|
||||
private String registrationId;
|
||||
|
||||
private OauthAppPojo app;
|
||||
private OauthApp app;
|
||||
|
||||
@Builder.Default
|
||||
private Map<String, String[]> parameters = new HashMap<>();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.app.handler;
|
||||
|
||||
import com.databasir.dao.enums.OAuthAppType;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -9,7 +9,7 @@ public interface OpenAuthHandler {
|
|||
|
||||
boolean support(OAuthAppType oauthAppType);
|
||||
|
||||
String authorizationUrl(OauthAppPojo app, Map<String, String[]> requestParams);
|
||||
String authorizationUrl(OauthApp app, Map<String, String[]> requestParams);
|
||||
|
||||
OAuthProcessResult process(OauthAppPojo app, Map<String, String[]> requestParams);
|
||||
OAuthProcessResult process(OauthApp app, Map<String, String[]> requestParams);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.databasir.core.domain.app.handler;
|
|||
|
||||
import com.databasir.core.domain.app.exception.DatabasirAuthenticationException;
|
||||
import com.databasir.dao.impl.OauthAppDao;
|
||||
import com.databasir.dao.tables.pojos.OauthAppPojo;
|
||||
import com.databasir.dao.tables.pojos.OauthApp;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class OpenAuthHandlers {
|
|||
private final OauthAppDao oauthAppDao;
|
||||
|
||||
public String authorizeUrl(String registrationId, Map<String, String[]> parameters) {
|
||||
OauthAppPojo app = oauthAppDao.selectByRegistrationId(registrationId);
|
||||
OauthApp app = oauthAppDao.selectByRegistrationId(registrationId);
|
||||
return handlers.stream()
|
||||
.filter(handler -> handler.support(app.getAppType()))
|
||||
.findFirst()
|
||||
|
@ -29,7 +29,7 @@ public class OpenAuthHandlers {
|
|||
}
|
||||
|
||||
public OAuthProcessResult process(String registrationId, Map<String, String[]> parameters) {
|
||||
OauthAppPojo app = oauthAppDao.selectOptionByRegistrationId(registrationId)
|
||||
OauthApp app = oauthAppDao.selectOptionByRegistrationId(registrationId)
|
||||
.orElseThrow(() -> {
|
||||
var bizErr = REGISTRATION_ID_NOT_FOUND.exception("应用 ID [" + registrationId + "] 不存在");
|
||||
return new DatabasirAuthenticationException(bizErr);
|
||||
|
|
|
@ -4,25 +4,25 @@ import com.databasir.core.domain.database.data.DatabaseTypeCreateRequest;
|
|||
import com.databasir.core.domain.database.data.DatabaseTypeDetailResponse;
|
||||
import com.databasir.core.domain.database.data.DatabaseTypePageResponse;
|
||||
import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest;
|
||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseType;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DatabaseTypePojoConverter {
|
||||
public interface DatabaseTypeConverter {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "jdbcDriverFilePath", source = "jdbcDriverFilePath")
|
||||
DatabaseTypePojo of(DatabaseTypeCreateRequest request, String jdbcDriverFilePath);
|
||||
DatabaseType of(DatabaseTypeCreateRequest request, String jdbcDriverFilePath);
|
||||
|
||||
@Mapping(target = "jdbcDriverFilePath", source = "jdbcDriverFilePath")
|
||||
DatabaseTypePojo of(DatabaseTypeUpdateRequest request, String jdbcDriverFilePath);
|
||||
DatabaseType of(DatabaseTypeUpdateRequest request, String jdbcDriverFilePath);
|
||||
|
||||
DatabaseTypePojo of(DatabaseTypeUpdateRequest request);
|
||||
DatabaseType of(DatabaseTypeUpdateRequest request);
|
||||
|
||||
DatabaseTypeDetailResponse toDetailResponse(DatabaseTypePojo data);
|
||||
DatabaseTypeDetailResponse toDetailResponse(DatabaseType data);
|
||||
|
||||
DatabaseTypePageResponse toPageResponse(DatabaseTypePojo pojo, Integer projectCount);
|
||||
DatabaseTypePageResponse toPageResponse(DatabaseType pojo, Integer projectCount);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.database.service;
|
||||
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.domain.database.converter.DatabaseTypePojoConverter;
|
||||
import com.databasir.core.domain.database.converter.DatabaseTypeConverter;
|
||||
import com.databasir.core.domain.database.data.*;
|
||||
import com.databasir.core.domain.database.validator.DatabaseTypeUpdateValidator;
|
||||
import com.databasir.core.infrastructure.connection.DatabaseTypes;
|
||||
|
@ -9,7 +9,7 @@ import com.databasir.core.infrastructure.driver.DriverResources;
|
|||
import com.databasir.core.infrastructure.driver.DriverResult;
|
||||
import com.databasir.dao.impl.DatabaseTypeDao;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -40,7 +40,7 @@ public class DatabaseTypeService {
|
|||
|
||||
private final ProjectDao projectDao;
|
||||
|
||||
private final DatabaseTypePojoConverter databaseTypePojoConverter;
|
||||
private final DatabaseTypeConverter databaseTypeConverter;
|
||||
|
||||
private final DatabaseTypeUpdateValidator databaseTypeUpdateValidator;
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class DatabaseTypeService {
|
|||
DriverResult result = loadAndValidate(request.getJdbcDriverFileUrl(),
|
||||
request.getJdbcDriverFilePath(), request.getJdbcDriverClassName());
|
||||
String targetPath = driverResources.copyToStandardDirectory(result.getDriverFile(), databaseType);
|
||||
DatabaseTypePojo pojo = databaseTypePojoConverter.of(request, targetPath);
|
||||
DatabaseType pojo = databaseTypeConverter.of(request, targetPath);
|
||||
// TODO workaround
|
||||
pojo.setJdbcDriverFileUrl(StringUtils.defaultIfBlank(request.getJdbcDriverFileUrl(), ""));
|
||||
try {
|
||||
|
@ -77,7 +77,7 @@ public class DatabaseTypeService {
|
|||
databaseTypeDao.selectOptionalById(request.getId()).ifPresent(data -> {
|
||||
databaseTypeUpdateValidator.validDatabaseTypeIfNecessary(request, data);
|
||||
String databaseType = request.getDatabaseType();
|
||||
DatabaseTypePojo pojo;
|
||||
DatabaseType pojo;
|
||||
if (databaseTypeUpdateValidator.shouldReloadDriver(request, data)) {
|
||||
// 名称修改,下载地址修改需要删除原有的 driver 并重新下载验证
|
||||
driverResources.deleteByDatabaseType(data.getDatabaseType());
|
||||
|
@ -85,10 +85,10 @@ public class DatabaseTypeService {
|
|||
DriverResult result = loadAndValidate(request.getJdbcDriverFileUrl(),
|
||||
request.getJdbcDriverFilePath(), request.getJdbcDriverClassName());
|
||||
String targetPath = driverResources.copyToStandardDirectory(result.getDriverFile(), databaseType);
|
||||
pojo = databaseTypePojoConverter.of(request, targetPath);
|
||||
pojo = databaseTypeConverter.of(request, targetPath);
|
||||
pojo.setJdbcDriverFileUrl(StringUtils.defaultIfBlank(request.getJdbcDriverFileUrl(), ""));
|
||||
} else {
|
||||
pojo = databaseTypePojoConverter.of(request);
|
||||
pojo = databaseTypeConverter.of(request);
|
||||
pojo.setJdbcDriverFileUrl(StringUtils.defaultIfBlank(request.getJdbcDriverFileUrl(), ""));
|
||||
}
|
||||
|
||||
|
@ -123,13 +123,13 @@ public class DatabaseTypeService {
|
|||
|
||||
public Page<DatabaseTypePageResponse> findByPage(Pageable page,
|
||||
DatabaseTypePageCondition condition) {
|
||||
Page<DatabaseTypePojo> pageData = databaseTypeDao.selectByPage(page, condition.toCondition());
|
||||
List<String> databaseTypes = pageData.map(DatabaseTypePojo::getDatabaseType).toList();
|
||||
Page<DatabaseType> pageData = databaseTypeDao.selectByPage(page, condition.toCondition());
|
||||
List<String> databaseTypes = pageData.map(DatabaseType::getDatabaseType).toList();
|
||||
Map<String, Integer> projectCountMapByDatabaseType = projectDao.countByDatabaseTypes(databaseTypes);
|
||||
return pageData
|
||||
.map(data -> {
|
||||
Integer count = projectCountMapByDatabaseType.getOrDefault(data.getDatabaseType(), 0);
|
||||
return databaseTypePojoConverter.toPageResponse(data, count);
|
||||
return databaseTypeConverter.toPageResponse(data, count);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class DatabaseTypeService {
|
|||
|
||||
public Optional<DatabaseTypeDetailResponse> selectOne(Integer id) {
|
||||
return databaseTypeDao.selectOptionalById(id)
|
||||
.map(databaseTypePojoConverter::toDetailResponse);
|
||||
.map(databaseTypeConverter::toDetailResponse);
|
||||
}
|
||||
|
||||
public String resolveDriverClassName(DriverClassNameResolveRequest request) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.databasir.core.domain.database.data.DatabaseTypeCreateRequest;
|
|||
import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest;
|
||||
import com.databasir.core.domain.database.data.DriverClassNameResolveRequest;
|
||||
import com.databasir.dao.impl.DatabaseTypeDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -36,7 +36,7 @@ public class DatabaseTypeUpdateValidator {
|
|||
}
|
||||
}
|
||||
|
||||
public void validDatabaseTypeIfNecessary(DatabaseTypeUpdateRequest request, DatabaseTypePojo origin) {
|
||||
public void validDatabaseTypeIfNecessary(DatabaseTypeUpdateRequest request, DatabaseType origin) {
|
||||
if (!Objects.equals(request.getDatabaseType(), origin.getDatabaseType())) {
|
||||
if (databaseTypeDao.existsByDatabaseType(request.getDatabaseType())) {
|
||||
throw DomainErrors.DATABASE_TYPE_NAME_DUPLICATE.exception();
|
||||
|
@ -44,7 +44,7 @@ public class DatabaseTypeUpdateValidator {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean shouldReloadDriver(DatabaseTypeUpdateRequest request, DatabaseTypePojo origin) {
|
||||
public boolean shouldReloadDriver(DatabaseTypeUpdateRequest request, DatabaseType origin) {
|
||||
if (!Objects.equals(request.getDatabaseType(), origin.getDatabaseType())) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package com.databasir.core.domain.description.converter;
|
||||
|
||||
import com.databasir.core.domain.description.data.DocumentDescriptionSaveRequest;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescriptionPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescription;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DocumentDescriptionPojoConverter {
|
||||
public interface DocumentDescriptionConverter {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
DocumentDescriptionPojo of(Integer projectId,
|
||||
DocumentDescription of(Integer projectId,
|
||||
Integer updateBy,
|
||||
DocumentDescriptionSaveRequest request);
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package com.databasir.core.domain.description.service;
|
||||
|
||||
import com.databasir.core.domain.description.converter.DocumentDescriptionPojoConverter;
|
||||
import com.databasir.core.domain.description.converter.DocumentDescriptionConverter;
|
||||
import com.databasir.core.domain.description.data.DocumentDescriptionSaveRequest;
|
||||
import com.databasir.core.domain.description.event.DescriptionUpdated;
|
||||
import com.databasir.core.infrastructure.event.EventPublisher;
|
||||
import com.databasir.dao.impl.DocumentDescriptionDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescriptionPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescription;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -16,7 +16,7 @@ public class DocumentDescriptionService {
|
|||
|
||||
private final DocumentDescriptionDao documentDescriptionDao;
|
||||
|
||||
private final DocumentDescriptionPojoConverter documentDescriptionPojoConverter;
|
||||
private final DocumentDescriptionConverter documentDescriptionConverter;
|
||||
|
||||
private final EventPublisher eventPublisher;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class DocumentDescriptionService {
|
|||
Integer userId,
|
||||
DocumentDescriptionSaveRequest request) {
|
||||
|
||||
DocumentDescriptionPojo pojo = documentDescriptionPojoConverter.of(projectId, userId, request);
|
||||
DocumentDescription pojo = documentDescriptionConverter.of(projectId, userId, request);
|
||||
if (!documentDescriptionDao.exists(projectId, request.getTableName(), request.getColumnName())) {
|
||||
documentDescriptionDao.insertAndReturnId(pojo);
|
||||
} else {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.databasir.core.domain.discussion.converter;
|
||||
|
||||
import com.databasir.core.domain.discussion.data.DiscussionResponse;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -12,6 +12,6 @@ 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);
|
||||
DiscussionResponse of(DocumentDiscussion discussion,
|
||||
User discussBy);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.discussion.event.converter;
|
||||
|
||||
import com.databasir.core.domain.discussion.event.DiscussionCreated;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussion;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -9,6 +9,6 @@ import org.mapstruct.Mapping;
|
|||
public interface DiscussionEventConverter {
|
||||
|
||||
@Mapping(target = "createByUserId", source = "pojo.userId")
|
||||
DiscussionCreated of(DocumentDiscussionPojo pojo, Integer discussionId);
|
||||
DiscussionCreated of(DocumentDiscussion pojo, Integer discussionId);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ import com.databasir.core.infrastructure.event.EventPublisher;
|
|||
import com.databasir.dao.impl.DocumentDiscussionDao;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
@ -54,19 +54,19 @@ public class DocumentDiscussionService {
|
|||
Pageable pageable,
|
||||
DiscussionListCondition condition) {
|
||||
if (projectDao.exists(groupId, projectId)) {
|
||||
Page<DocumentDiscussionPojo> data =
|
||||
Page<DocumentDiscussion> data =
|
||||
documentDiscussionDao.selectByPage(pageable, condition.toCondition(projectId));
|
||||
Set<Integer> userIdList = data.getContent()
|
||||
.stream()
|
||||
.map(DocumentDiscussionPojo::getUserId)
|
||||
.map(DocumentDiscussion::getUserId)
|
||||
.collect(Collectors.toSet());
|
||||
Map<Integer, UserPojo> userMapById = userDao.selectUserIdIn(userIdList)
|
||||
Map<Integer, User> userMapById = userDao.selectUserIdIn(userIdList)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(UserPojo::getId, Function.identity()));
|
||||
.collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
return data
|
||||
.map(discussionPojo -> {
|
||||
UserPojo userPojo = userMapById.get(discussionPojo.getUserId());
|
||||
return discussionResponseConverter.of(discussionPojo, userPojo);
|
||||
User user = userMapById.get(discussionPojo.getUserId());
|
||||
return discussionResponseConverter.of(discussionPojo, user);
|
||||
});
|
||||
} else {
|
||||
throw new Forbidden();
|
||||
|
@ -75,7 +75,7 @@ public class DocumentDiscussionService {
|
|||
|
||||
public void create(Integer groupId, Integer projectId, Integer userId, DiscussionCreateRequest request) {
|
||||
if (projectDao.exists(groupId, projectId)) {
|
||||
DocumentDiscussionPojo pojo = new DocumentDiscussionPojo();
|
||||
DocumentDiscussion pojo = new DocumentDiscussion();
|
||||
pojo.setUserId(userId);
|
||||
pojo.setProjectId(projectId);
|
||||
pojo.setContent(request.getContent());
|
||||
|
|
|
@ -16,25 +16,25 @@ import java.util.stream.Collectors;
|
|||
@Mapper(componentModel = "spring", uses = JsonConverter.class)
|
||||
public interface DatabaseMetaConverter {
|
||||
|
||||
default DatabaseMeta of(DatabaseDocumentPojo database,
|
||||
List<TableDocumentPojo> tables,
|
||||
List<TableColumnDocumentPojo> columns,
|
||||
List<TableIndexDocumentPojo> indexes,
|
||||
List<TableTriggerDocumentPojo> triggers,
|
||||
List<TableForeignKeyDocumentPojo> foreignKeys) {
|
||||
var columnMap = groupBy(columns, TableColumnDocumentPojo::getTableDocumentId);
|
||||
var indexMap = groupBy(indexes, TableIndexDocumentPojo::getTableDocumentId);
|
||||
var triggerMap = groupBy(triggers, TableTriggerDocumentPojo::getTableDocumentId);
|
||||
var fkMap = groupBy(foreignKeys, TableForeignKeyDocumentPojo::getTableDocumentId);
|
||||
default DatabaseMeta of(DatabaseDocument database,
|
||||
List<TableDocument> tables,
|
||||
List<TableColumnDocument> columns,
|
||||
List<TableIndexDocument> indexes,
|
||||
List<TableTriggerDocument> triggers,
|
||||
List<TableForeignKeyDocument> foreignKeys) {
|
||||
var columnMap = groupBy(columns, TableColumnDocument::getTableDocumentId);
|
||||
var indexMap = groupBy(indexes, TableIndexDocument::getTableDocumentId);
|
||||
var triggerMap = groupBy(triggers, TableTriggerDocument::getTableDocumentId);
|
||||
var fkMap = groupBy(foreignKeys, TableForeignKeyDocument::getTableDocumentId);
|
||||
return of(database, tables, columnMap, indexMap, triggerMap, fkMap);
|
||||
}
|
||||
|
||||
default DatabaseMeta of(DatabaseDocumentPojo database,
|
||||
List<TableDocumentPojo> tables,
|
||||
Map<Integer, List<TableColumnDocumentPojo>> columnGroupByTableId,
|
||||
Map<Integer, List<TableIndexDocumentPojo>> indexGroupByTableId,
|
||||
Map<Integer, List<TableTriggerDocumentPojo>> triggerGroupByTableId,
|
||||
Map<Integer, List<TableForeignKeyDocumentPojo>> fkGroupByTableId) {
|
||||
default DatabaseMeta of(DatabaseDocument database,
|
||||
List<TableDocument> tables,
|
||||
Map<Integer, List<TableColumnDocument>> columnGroupByTableId,
|
||||
Map<Integer, List<TableIndexDocument>> indexGroupByTableId,
|
||||
Map<Integer, List<TableTriggerDocument>> triggerGroupByTableId,
|
||||
Map<Integer, List<TableForeignKeyDocument>> fkGroupByTableId) {
|
||||
List<TableMeta> tableMetas = tables.stream()
|
||||
.map(table -> {
|
||||
Integer id = table.getId();
|
||||
|
@ -48,22 +48,22 @@ public interface DatabaseMetaConverter {
|
|||
return of(database, tableMetas);
|
||||
}
|
||||
|
||||
DatabaseMeta of(DatabaseDocumentPojo database, List<TableMeta> tables);
|
||||
DatabaseMeta of(DatabaseDocument database, List<TableMeta> tables);
|
||||
|
||||
TableMeta of(TableDocumentPojo table,
|
||||
List<TableColumnDocumentPojo> columns,
|
||||
List<TableIndexDocumentPojo> indexes,
|
||||
List<TableTriggerDocumentPojo> triggers,
|
||||
List<TableForeignKeyDocumentPojo> foreignKeys);
|
||||
TableMeta of(TableDocument table,
|
||||
List<TableColumnDocument> columns,
|
||||
List<TableIndexDocument> indexes,
|
||||
List<TableTriggerDocument> triggers,
|
||||
List<TableForeignKeyDocument> foreignKeys);
|
||||
|
||||
ColumnMeta of(TableColumnDocumentPojo pojo);
|
||||
ColumnMeta of(TableColumnDocument pojo);
|
||||
|
||||
@Mapping(target = "isUniqueKey", source = "pojo.isUnique")
|
||||
@Mapping(target = "columnNames", source = "pojo.columnNameArray")
|
||||
IndexMeta of(TableIndexDocumentPojo pojo);
|
||||
IndexMeta of(TableIndexDocument pojo);
|
||||
|
||||
@Mapping(target = "createAt", source = "pojo.triggerCreateAt")
|
||||
TriggerMeta of(TableTriggerDocumentPojo pojo);
|
||||
TriggerMeta of(TableTriggerDocument pojo);
|
||||
|
||||
List<TableMeta> of(List<TableDocumentResponse> table);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.mapstruct.Mapper;
|
|||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DocumentFullTextPojoConverter {
|
||||
public interface DocumentFullTextConverter {
|
||||
|
||||
/**
|
||||
* groupName、groupDescription, projectName, projectDescription 等信息需要动态获取,所以不保存
|
||||
|
@ -28,11 +28,11 @@ public interface DocumentFullTextPojoConverter {
|
|||
@Mapping(target = "groupDescription", ignore = true)
|
||||
@Mapping(target = "projectName", ignore = true)
|
||||
@Mapping(target = "projectDescription", ignore = true)
|
||||
DocumentFullTextPojo toPojo(GroupPojo group,
|
||||
ProjectPojo project,
|
||||
DatabaseDocumentPojo db,
|
||||
TableDocumentPojo table,
|
||||
TableColumnDocumentPojo column,
|
||||
DocumentFullText toPojo(Group group,
|
||||
Project project,
|
||||
DatabaseDocument db,
|
||||
TableDocument table,
|
||||
TableColumnDocument column,
|
||||
String tableDescription,
|
||||
String columnDescription);
|
||||
}
|
|
@ -16,14 +16,14 @@ public interface DocumentPojoConverter {
|
|||
@Mapping(target = "databaseName", source = "meta.databaseName")
|
||||
@Mapping(target = "schemaName", source = "meta.schemaName")
|
||||
@Mapping(target = "isArchive", constant = "false")
|
||||
DatabaseDocumentPojo toDatabasePojo(Integer projectId,
|
||||
DatabaseDocument toDatabasePojo(Integer projectId,
|
||||
DatabaseMeta meta,
|
||||
Long version);
|
||||
|
||||
TableDocumentPojo toTablePojo(Integer databaseDocumentId,
|
||||
TableDocument toTablePojo(Integer databaseDocumentId,
|
||||
com.databasir.core.meta.data.TableMeta meta);
|
||||
|
||||
default List<TableColumnDocumentPojo> toColumnPojo(Integer databaseDocumentId,
|
||||
default List<TableColumnDocument> toColumnPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
List<ColumnMeta> metaList) {
|
||||
return metaList.stream()
|
||||
|
@ -31,11 +31,11 @@ public interface DocumentPojoConverter {
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
TableColumnDocumentPojo toColumnPojo(Integer databaseDocumentId,
|
||||
TableColumnDocument toColumnPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
ColumnMeta meta);
|
||||
|
||||
default List<TableIndexDocumentPojo> toIndexPojo(Integer databaseDocumentId,
|
||||
default List<TableIndexDocument> toIndexPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
List<IndexMeta> metaList) {
|
||||
return metaList.stream()
|
||||
|
@ -45,11 +45,11 @@ public interface DocumentPojoConverter {
|
|||
|
||||
@Mapping(target = "isUnique", source = "meta.isUniqueKey")
|
||||
@Mapping(target = "columnNameArray", source = "meta.columnNames")
|
||||
TableIndexDocumentPojo toIndexPojo(Integer databaseDocumentId,
|
||||
TableIndexDocument toIndexPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
IndexMeta meta);
|
||||
|
||||
default List<TableTriggerDocumentPojo> toTriggerPojo(Integer databaseDocumentId,
|
||||
default List<TableTriggerDocument> toTriggerPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
List<TriggerMeta> metaList) {
|
||||
return metaList.stream()
|
||||
|
@ -59,11 +59,11 @@ public interface DocumentPojoConverter {
|
|||
|
||||
@Mapping(target = "triggerCreateAt", source = "meta.createAt")
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
TableTriggerDocumentPojo toTriggerPojo(Integer databaseDocumentId,
|
||||
TableTriggerDocument toTriggerPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
TriggerMeta meta);
|
||||
|
||||
default List<TableForeignKeyDocumentPojo> toForeignKeyPojo(Integer docId,
|
||||
default List<TableForeignKeyDocument> toForeignKeyPojo(Integer docId,
|
||||
Integer tableMetaId,
|
||||
List<ForeignKeyMeta> foreignKeys) {
|
||||
return foreignKeys.stream()
|
||||
|
@ -73,7 +73,7 @@ public interface DocumentPojoConverter {
|
|||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
TableForeignKeyDocumentPojo toForeignKeyPojo(Integer databaseDocumentId,
|
||||
TableForeignKeyDocument toForeignKeyPojo(Integer databaseDocumentId,
|
||||
Integer tableDocumentId,
|
||||
ForeignKeyMeta foreignKey);
|
||||
|
||||
|
|
|
@ -19,31 +19,31 @@ public interface DocumentResponseConverter {
|
|||
@Mapping(target = "indexes", source = "indexes")
|
||||
@Mapping(target = "foreignKeys", source = "foreignKeys")
|
||||
@Mapping(target = "triggers", source = "triggers")
|
||||
TableDocumentResponse of(TableDocumentPojo tableDocument,
|
||||
List<TableColumnDocumentPojo> columns,
|
||||
List<TableIndexDocumentPojo> indexes,
|
||||
List<TableForeignKeyDocumentPojo> foreignKeys,
|
||||
List<TableTriggerDocumentPojo> triggers);
|
||||
TableDocumentResponse of(TableDocument tableDocument,
|
||||
List<TableColumnDocument> columns,
|
||||
List<TableIndexDocument> indexes,
|
||||
List<TableForeignKeyDocument> foreignKeys,
|
||||
List<TableTriggerDocument> triggers);
|
||||
|
||||
@Mapping(target = "columns", source = "columns")
|
||||
@Mapping(target = "indexes", source = "indexes")
|
||||
@Mapping(target = "foreignKeys", source = "foreignKeys")
|
||||
@Mapping(target = "triggers", source = "triggers")
|
||||
@SuppressWarnings("checkstyle:all")
|
||||
TableDocumentResponse of(TableDocumentPojo tableDocument,
|
||||
TableDocumentResponse of(TableDocument tableDocument,
|
||||
Integer discussionCount,
|
||||
String description,
|
||||
List<TableDocumentResponse.ColumnDocumentResponse> columns,
|
||||
List<TableIndexDocumentPojo> indexes,
|
||||
List<TableForeignKeyDocumentPojo> foreignKeys,
|
||||
List<TableTriggerDocumentPojo> triggers);
|
||||
List<TableIndexDocument> indexes,
|
||||
List<TableForeignKeyDocument> foreignKeys,
|
||||
List<TableTriggerDocument> triggers);
|
||||
|
||||
TableDocumentResponse.ColumnDocumentResponse of(TableColumnDocumentPojo pojo,
|
||||
TableDocumentResponse.ColumnDocumentResponse of(TableColumnDocument pojo,
|
||||
Integer discussionCount,
|
||||
String description);
|
||||
|
||||
default List<TableDocumentResponse.ColumnDocumentResponse> of(
|
||||
List<TableColumnDocumentPojo> columns,
|
||||
List<TableColumnDocument> columns,
|
||||
String tableName,
|
||||
Map<String, Integer> discussionCountMapByJoinName,
|
||||
Map<String, String> descriptionMapByJoinName) {
|
||||
|
@ -57,11 +57,11 @@ public interface DocumentResponseConverter {
|
|||
}
|
||||
|
||||
@Mapping(target = "columnNames", source = "columnNameArray")
|
||||
TableDocumentResponse.IndexDocumentResponse of(TableIndexDocumentPojo indexDocument);
|
||||
TableDocumentResponse.IndexDocumentResponse of(TableIndexDocument indexDocument);
|
||||
|
||||
@Mapping(target = "id", source = "databaseDocument.id")
|
||||
@Mapping(target = "createAt", source = "databaseDocument.createAt")
|
||||
@Mapping(target = "documentVersion", source = "databaseDocument.version")
|
||||
DatabaseDocumentResponse of(DatabaseDocumentPojo databaseDocument,
|
||||
DatabaseDocumentResponse of(DatabaseDocument databaseDocument,
|
||||
List<TableDocumentResponse> tables);
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.databasir.core.domain.document.converter;
|
|||
import com.databasir.core.diff.data.DiffType;
|
||||
import com.databasir.core.domain.document.data.DatabaseDocumentSimpleResponse;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocument;
|
||||
import com.databasir.dao.tables.pojos.TableDocument;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
@ -19,16 +19,16 @@ public interface DocumentSimpleResponseConverter {
|
|||
@Mapping(target = "id", source = "databaseDocument.id")
|
||||
@Mapping(target = "createAt", source = "databaseDocument.createAt")
|
||||
@Mapping(target = "documentVersion", source = "databaseDocument.version")
|
||||
DatabaseDocumentSimpleResponse of(DatabaseDocumentPojo databaseDocument,
|
||||
DatabaseDocumentSimpleResponse of(DatabaseDocument databaseDocument,
|
||||
List<DatabaseDocumentSimpleResponse.TableData> tables,
|
||||
DiffType diffType,
|
||||
String projectName);
|
||||
|
||||
DatabaseDocumentSimpleResponse.TableData of(TableDocumentPojo tables,
|
||||
DatabaseDocumentSimpleResponse.TableData of(TableDocument tables,
|
||||
Integer discussionCount,
|
||||
String description);
|
||||
|
||||
default List<DatabaseDocumentSimpleResponse.TableData> of(List<TableDocumentPojo> tables,
|
||||
default List<DatabaseDocumentSimpleResponse.TableData> of(List<TableDocument> tables,
|
||||
Map<String, Integer> discussionCountMapByTableName,
|
||||
Map<String, String> descriptionMapByTableName) {
|
||||
return tables.stream()
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.databasir.core.domain.document.converter;
|
|||
|
||||
import com.databasir.core.domain.document.data.DocumentTemplatePropertiesUpdateRequest;
|
||||
import com.databasir.dao.enums.DocumentTemplatePropertyType;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplateProperty;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -13,10 +13,10 @@ import java.util.stream.Collectors;
|
|||
public interface DocumentTemplatePropertiesUpdateRequestConverter {
|
||||
|
||||
@Mapping(target = "defaultValue", constant = "")
|
||||
DocumentTemplatePropertyPojo toPojo(DocumentTemplatePropertiesUpdateRequest.PropertyRequest property,
|
||||
DocumentTemplateProperty toPojo(DocumentTemplatePropertiesUpdateRequest.PropertyRequest property,
|
||||
DocumentTemplatePropertyType type);
|
||||
|
||||
default List<DocumentTemplatePropertyPojo> toPojo(DocumentTemplatePropertiesUpdateRequest request) {
|
||||
default List<DocumentTemplateProperty> toPojo(DocumentTemplatePropertiesUpdateRequest request) {
|
||||
return request.getProperties().stream()
|
||||
.map(prop -> toPojo(prop, request.getType()))
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.document.converter;
|
||||
|
||||
import com.databasir.core.domain.document.data.DocumentTemplatePropertiesResponse;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplateProperty;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -10,6 +10,6 @@ import java.util.List;
|
|||
public interface DocumentTemplatePropertyResponseConverter {
|
||||
|
||||
List<DocumentTemplatePropertiesResponse.DocumentTemplatePropertyResponse> of(
|
||||
List<DocumentTemplatePropertyPojo> pojoList);
|
||||
List<DocumentTemplateProperty> pojoList);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.databasir.core.domain.document.converter;
|
||||
|
||||
import com.databasir.core.domain.document.data.TableResponse;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import com.databasir.dao.tables.pojos.TableDocument;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -12,14 +12,14 @@ import java.util.stream.Collectors;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface TableResponseConverter {
|
||||
|
||||
default List<TableResponse> from(List<TableDocumentPojo> tables,
|
||||
Map<Integer, List<TableColumnDocumentPojo>> columnMapByTableId) {
|
||||
default List<TableResponse> from(List<TableDocument> tables,
|
||||
Map<Integer, List<TableColumnDocument>> columnMapByTableId) {
|
||||
return tables.stream()
|
||||
.map(table -> from(table, columnMapByTableId.get(table.getId())))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
TableResponse from(TableDocumentPojo table, List<TableColumnDocumentPojo> columns);
|
||||
TableResponse from(TableDocument table, List<TableColumnDocument> columns);
|
||||
|
||||
TableResponse.ColumnResponse from(TableColumnDocumentPojo column);
|
||||
TableResponse.ColumnResponse from(TableColumnDocument column);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,8 @@ public class DocumentUpdated {
|
|||
|
||||
private Integer projectId;
|
||||
|
||||
private Integer databaseDocumentId;
|
||||
|
||||
public Optional<Long> getOldVersion() {
|
||||
return Optional.ofNullable(oldVersion);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class DocumentService {
|
|||
|
||||
private final DocumentPojoConverter documentPojoConverter;
|
||||
|
||||
private final DocumentFullTextPojoConverter documentFullTextPojoConverter;
|
||||
private final DocumentFullTextConverter documentFullTextConverter;
|
||||
|
||||
private final DocumentResponseConverter documentResponseConverter;
|
||||
|
||||
|
@ -102,9 +102,9 @@ public class DocumentService {
|
|||
projectDao.selectOptionalById(projectId)
|
||||
.orElseThrow(DomainErrors.PROJECT_NOT_FOUND::exception);
|
||||
DatabaseMeta current = retrieveDatabaseMeta(projectId);
|
||||
Optional<DatabaseDocumentPojo> originalOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
Optional<DatabaseDocument> originalOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
if (originalOption.isPresent()) {
|
||||
DatabaseDocumentPojo original = originalOption.get();
|
||||
DatabaseDocument original = originalOption.get();
|
||||
DatabaseMeta originalMeta = retrieveOriginalDatabaseMeta(original);
|
||||
RootDiff diff = Diffs.diff(originalMeta, current);
|
||||
if (diff.getDiffType() == DiffType.NONE) {
|
||||
|
@ -117,34 +117,34 @@ public class DocumentService {
|
|||
// archive old version
|
||||
databaseDocumentDao.updateIsArchiveById(previousDocumentId, true);
|
||||
Long version = original.getVersion();
|
||||
saveNewDocument(current, version + 1, original.getProjectId());
|
||||
eventPublisher.publish(new DocumentUpdated(diff, version + 1, version, projectId));
|
||||
Integer docId = saveNewDocument(current, version + 1, original.getProjectId());
|
||||
eventPublisher.publish(new DocumentUpdated(diff, version + 1, version, projectId, docId));
|
||||
} else {
|
||||
saveNewDocument(current, 1L, projectId);
|
||||
Integer docId = saveNewDocument(current, 1L, projectId);
|
||||
RootDiff diff = null;
|
||||
try {
|
||||
diff = Diffs.diff(null, current);
|
||||
} catch (Exception e) {
|
||||
log.error("diff project " + projectId + " error, fallback diff type to NONE", e);
|
||||
}
|
||||
eventPublisher.publish(new DocumentUpdated(diff, 1L, null, projectId));
|
||||
eventPublisher.publish(new DocumentUpdated(diff, 1L, null, projectId, docId));
|
||||
}
|
||||
}
|
||||
|
||||
private DatabaseMeta retrieveOriginalDatabaseMeta(DatabaseDocumentPojo original) {
|
||||
private DatabaseMeta retrieveOriginalDatabaseMeta(DatabaseDocument original) {
|
||||
Integer docId = original.getId();
|
||||
List<TableDocumentPojo> tables = tableDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableColumnDocumentPojo> columns = tableColumnDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableIndexDocumentPojo> indexes = tableIndexDocumentDao.selectByDatabaseMetaId(docId);
|
||||
List<TableTriggerDocumentPojo> triggers = tableTriggerDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableForeignKeyDocumentPojo> fks = tableForeignKeyDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableDocument> tables = tableDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableColumnDocument> columns = tableColumnDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableIndexDocument> indexes = tableIndexDocumentDao.selectByDatabaseMetaId(docId);
|
||||
List<TableTriggerDocument> triggers = tableTriggerDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
List<TableForeignKeyDocument> fks = tableForeignKeyDocumentDao.selectByDatabaseDocumentId(docId);
|
||||
return databaseMetaConverter.of(original, tables, columns, indexes, triggers, fks);
|
||||
}
|
||||
|
||||
private DatabaseMeta retrieveDatabaseMeta(Integer projectId) {
|
||||
ProjectSyncRulePojo rule = projectSyncRuleDao.selectByProjectId(projectId);
|
||||
DataSourcePojo dataSource = dataSourceDao.selectByProjectId(projectId);
|
||||
List<DataSourcePropertyPojo> properties = dataSourcePropertyDao.selectByDataSourceId(dataSource.getId());
|
||||
ProjectSyncRule rule = projectSyncRuleDao.selectByProjectId(projectId);
|
||||
DataSource dataSource = dataSourceDao.selectByProjectId(projectId);
|
||||
List<DataSourceProperty> properties = dataSourcePropertyDao.selectByDataSourceId(dataSource.getId());
|
||||
Connection jdbcConnection = databaseConnectionService.create(dataSource, properties);
|
||||
DatabasirConfig databasirConfig = new DatabasirConfig();
|
||||
databasirConfig.setIgnoreTableNameRegex(jsonConverter.fromJson(rule.getIgnoreTableNameRegexArray()));
|
||||
|
@ -168,9 +168,9 @@ public class DocumentService {
|
|||
}
|
||||
}
|
||||
|
||||
private void saveNewDocument(DatabaseMeta meta,
|
||||
Long version,
|
||||
Integer projectId) {
|
||||
private Integer saveNewDocument(DatabaseMeta meta,
|
||||
Long version,
|
||||
Integer projectId) {
|
||||
|
||||
var dbDocPojo = documentPojoConverter.toDatabasePojo(projectId, meta, version);
|
||||
final Integer docId;
|
||||
|
@ -182,7 +182,7 @@ public class DocumentService {
|
|||
throw new DatabasirException(DomainErrors.DATABASE_DOCUMENT_DUPLICATE_KEY);
|
||||
}
|
||||
meta.getTables().forEach(table -> {
|
||||
TableDocumentPojo tableMeta =
|
||||
TableDocument tableMeta =
|
||||
documentPojoConverter.toTablePojo(docId, table);
|
||||
Integer tableMetaId = tableDocumentDao.insertAndReturnId(tableMeta);
|
||||
tableMeta.setId(tableMetaId);
|
||||
|
@ -209,42 +209,27 @@ public class DocumentService {
|
|||
// trigger
|
||||
var triggers = documentPojoConverter.toTriggerPojo(docId, tableMetaId, table.getTriggers());
|
||||
tableTriggerDocumentDao.batchInsert(triggers);
|
||||
|
||||
// save full text
|
||||
var descriptionMapByJoinName = documentDescriptionDao.selectByProjectId(projectId)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
d -> {
|
||||
if (d.getColumnName() == null) {
|
||||
return d.getTableName();
|
||||
}
|
||||
return String.join(".",
|
||||
d.getTableName(),
|
||||
StringUtils.defaultIfBlank(d.getColumnName(), ""));
|
||||
},
|
||||
DocumentDescriptionPojo::getContent,
|
||||
(a, b) -> a));
|
||||
saveDocumentFullText(projectId, dbDocPojo, tableMeta, descriptionMapByJoinName);
|
||||
});
|
||||
log.info("save new version document success: projectId = {}, name = {}, version = {}",
|
||||
projectId, meta.getDatabaseName(), version);
|
||||
return docId;
|
||||
}
|
||||
|
||||
private void saveDocumentFullText(Integer projectId,
|
||||
DatabaseDocumentPojo database,
|
||||
TableDocumentPojo table,
|
||||
DatabaseDocument database,
|
||||
TableDocument table,
|
||||
Map<String, String> descriptionMapByJoinName) {
|
||||
ProjectPojo project = projectDao.selectById(projectId);
|
||||
GroupPojo group = groupDao.selectById(project.getGroupId());
|
||||
List<TableColumnDocumentPojo> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
|
||||
Project project = projectDao.selectById(projectId);
|
||||
Group group = groupDao.selectById(project.getGroupId());
|
||||
List<TableColumnDocument> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
|
||||
// clear outdated data before save
|
||||
documentFullTextDao.deleteTableFullText(table.getId());
|
||||
List<DocumentFullTextPojo> fullTextPojoList = columns.stream()
|
||||
List<DocumentFullText> fullTextPojoList = columns.stream()
|
||||
.map(column -> {
|
||||
String tableName = table.getName();
|
||||
String tableDescription = descriptionMapByJoinName.get(tableName);
|
||||
String columnDescription = descriptionMapByJoinName.get(tableName + "." + column.getName());
|
||||
return documentFullTextPojoConverter.toPojo(group, project, database, table, column,
|
||||
return documentFullTextConverter.toPojo(group, project, database, table, column,
|
||||
tableDescription, columnDescription);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
@ -255,10 +240,10 @@ public class DocumentService {
|
|||
Long version,
|
||||
Long originalVersion) {
|
||||
String projectName = projectDao.selectOptionalById(projectId)
|
||||
.map(ProjectPojo::getName)
|
||||
.map(Project::getName)
|
||||
.orElseThrow(DomainErrors.PROJECT_NOT_FOUND::exception);
|
||||
|
||||
Optional<DatabaseDocumentPojo> documentOption;
|
||||
Optional<DatabaseDocument> documentOption;
|
||||
if (version == null) {
|
||||
documentOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
} else {
|
||||
|
@ -331,7 +316,7 @@ public class DocumentService {
|
|||
public List<TableDiffResult> tableDiffs(Integer projectId, Long originalVersion, Long currentVersion) {
|
||||
var original = databaseDocumentDao.selectOptionalByProjectIdAndVersion(projectId, originalVersion)
|
||||
.orElseThrow(DomainErrors.DOCUMENT_VERSION_IS_INVALID::exception);
|
||||
DatabaseDocumentPojo current;
|
||||
DatabaseDocument current;
|
||||
if (currentVersion == null) {
|
||||
current = databaseDocumentDao.selectNotArchivedByProjectId(projectId)
|
||||
.orElseThrow(DomainErrors.DOCUMENT_VERSION_IS_INVALID::exception);
|
||||
|
@ -346,7 +331,7 @@ public class DocumentService {
|
|||
|
||||
public Optional<DatabaseDocumentResponse> getOneByProjectId(Integer projectId, Long version) {
|
||||
|
||||
Optional<DatabaseDocumentPojo> documentOption;
|
||||
Optional<DatabaseDocument> documentOption;
|
||||
if (version == null) {
|
||||
documentOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
} else {
|
||||
|
@ -359,14 +344,14 @@ public class DocumentService {
|
|||
var indexes = tableIndexDocumentDao.selectByDatabaseMetaId(id);
|
||||
var triggers = tableTriggerDocumentDao.selectByDatabaseDocumentId(id);
|
||||
var foreignKeys = tableForeignKeyDocumentDao.selectByDatabaseDocumentId(id);
|
||||
Map<Integer, List<TableColumnDocumentPojo>> columnsGroupByTableMetaId = columns.stream()
|
||||
.collect(Collectors.groupingBy(TableColumnDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableIndexDocumentPojo>> indexesGroupByTableMetaId = indexes.stream()
|
||||
.collect(Collectors.groupingBy(TableIndexDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableTriggerDocumentPojo>> triggersGroupByTableMetaId = triggers.stream()
|
||||
.collect(Collectors.groupingBy(TableTriggerDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableForeignKeyDocumentPojo>> foreignKeysGroupByTableMetaId = foreignKeys.stream()
|
||||
.collect(Collectors.groupingBy(TableForeignKeyDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableColumnDocument>> columnsGroupByTableMetaId = columns.stream()
|
||||
.collect(Collectors.groupingBy(TableColumnDocument::getTableDocumentId));
|
||||
Map<Integer, List<TableIndexDocument>> indexesGroupByTableMetaId = indexes.stream()
|
||||
.collect(Collectors.groupingBy(TableIndexDocument::getTableDocumentId));
|
||||
Map<Integer, List<TableTriggerDocument>> triggersGroupByTableMetaId = triggers.stream()
|
||||
.collect(Collectors.groupingBy(TableTriggerDocument::getTableDocumentId));
|
||||
Map<Integer, List<TableForeignKeyDocument>> foreignKeysGroupByTableMetaId = foreignKeys.stream()
|
||||
.collect(Collectors.groupingBy(TableForeignKeyDocument::getTableDocumentId));
|
||||
var tableDocumentResponseList = tables.stream()
|
||||
.map(table -> {
|
||||
Integer tableId = table.getId();
|
||||
|
@ -412,26 +397,26 @@ public class DocumentService {
|
|||
// column
|
||||
var columns =
|
||||
tableColumnDocumentDao.selectByDatabaseDocumentIdAndTableIdIn(databaseDocumentId, tableIds);
|
||||
Map<Integer, List<TableColumnDocumentPojo>> columnsGroupByTableMetaId = columns.stream()
|
||||
.collect(Collectors.groupingBy(TableColumnDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableColumnDocument>> columnsGroupByTableMetaId = columns.stream()
|
||||
.collect(Collectors.groupingBy(TableColumnDocument::getTableDocumentId));
|
||||
|
||||
// index
|
||||
var indexes =
|
||||
tableIndexDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
||||
Map<Integer, List<TableIndexDocumentPojo>> indexesGroupByTableMetaId = indexes.stream()
|
||||
.collect(Collectors.groupingBy(TableIndexDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableIndexDocument>> indexesGroupByTableMetaId = indexes.stream()
|
||||
.collect(Collectors.groupingBy(TableIndexDocument::getTableDocumentId));
|
||||
|
||||
// foreign keys
|
||||
var foreignKeys =
|
||||
tableForeignKeyDocumentDao.selectByDatabaseDocumentIdAndTableIdIn(databaseDocumentId, tableIds);
|
||||
Map<Integer, List<TableForeignKeyDocumentPojo>> foreignKeysGroupByTableMetaId = foreignKeys.stream()
|
||||
.collect(Collectors.groupingBy(TableForeignKeyDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableForeignKeyDocument>> foreignKeysGroupByTableMetaId = foreignKeys.stream()
|
||||
.collect(Collectors.groupingBy(TableForeignKeyDocument::getTableDocumentId));
|
||||
|
||||
// trigger
|
||||
var triggers =
|
||||
tableTriggerDocumentDao.selectByDatabaseDocumentIdAndIdIn(databaseDocumentId, tableIds);
|
||||
Map<Integer, List<TableTriggerDocumentPojo>> triggersGroupByTableMetaId = triggers.stream()
|
||||
.collect(Collectors.groupingBy(TableTriggerDocumentPojo::getTableDocumentId));
|
||||
Map<Integer, List<TableTriggerDocument>> triggersGroupByTableMetaId = triggers.stream()
|
||||
.collect(Collectors.groupingBy(TableTriggerDocument::getTableDocumentId));
|
||||
|
||||
// discussion
|
||||
var discussions = documentDiscussionDao.selectAllDiscussionCount(projectId);
|
||||
|
@ -450,7 +435,7 @@ public class DocumentService {
|
|||
d -> String.join(".",
|
||||
d.getTableName(),
|
||||
StringUtils.defaultIfBlank(d.getColumnName(), "")),
|
||||
DocumentDescriptionPojo::getContent,
|
||||
DocumentDescription::getContent,
|
||||
(a, b) -> a));
|
||||
|
||||
return tables.stream()
|
||||
|
@ -491,7 +476,7 @@ public class DocumentService {
|
|||
List<Integer> currentTableIds = current.stream().map(t -> t.getId()).collect(Collectors.toList());
|
||||
var missedIds = CollectionUtils.disjunction(currentTableIds, request.getTableIds());
|
||||
if (request.getOriginalVersion() != null) {
|
||||
DatabaseDocumentPojo doc =
|
||||
DatabaseDocument doc =
|
||||
databaseDocumentDao.selectOptionalByProjectIdAndVersion(projectId, request.getOriginalVersion())
|
||||
.orElseThrow(DomainErrors.DOCUMENT_VERSION_IS_INVALID::exception);
|
||||
List<String> tableNames = current.stream().map(t -> t.getName()).distinct().collect(Collectors.toList());
|
||||
|
@ -544,7 +529,7 @@ public class DocumentService {
|
|||
doc = getOneByProjectId(projectId, version)
|
||||
.orElseThrow(DomainErrors.DOCUMENT_VERSION_IS_INVALID::exception);
|
||||
} else {
|
||||
DatabaseDocumentPojo databaseDoc;
|
||||
DatabaseDocument databaseDoc;
|
||||
if (version == null) {
|
||||
databaseDoc = databaseDocumentDao.selectNotArchivedByProjectId(projectId)
|
||||
.orElseThrow(DomainErrors.DOCUMENT_VERSION_IS_INVALID::exception);
|
||||
|
@ -567,7 +552,7 @@ public class DocumentService {
|
|||
}
|
||||
|
||||
public List<TableResponse> getTableAndColumns(Integer projectId, Long version) {
|
||||
Optional<DatabaseDocumentPojo> documentOption;
|
||||
Optional<DatabaseDocument> documentOption;
|
||||
if (version == null) {
|
||||
documentOption = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
} else {
|
||||
|
@ -576,11 +561,11 @@ public class DocumentService {
|
|||
if (documentOption.isEmpty()) {
|
||||
return emptyList();
|
||||
} else {
|
||||
DatabaseDocumentPojo databaseDoc = documentOption.get();
|
||||
DatabaseDocument databaseDoc = documentOption.get();
|
||||
var tables = tableDocumentDao.selectByDatabaseDocumentId(databaseDoc.getId());
|
||||
var columns = tableColumnDocumentDao.selectByDatabaseDocumentId(databaseDoc.getId());
|
||||
var columnMapByTableId = columns.stream()
|
||||
.collect(Collectors.groupingBy(TableColumnDocumentPojo::getTableDocumentId));
|
||||
.collect(Collectors.groupingBy(TableColumnDocument::getTableDocumentId));
|
||||
return tableResponseConverter.from(tables, columnMapByTableId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.databasir.core.domain.document.converter.DocumentTemplatePropertyResp
|
|||
import com.databasir.core.domain.document.data.DocumentTemplatePropertiesResponse;
|
||||
import com.databasir.core.domain.document.data.DocumentTemplatePropertiesUpdateRequest;
|
||||
import com.databasir.dao.impl.DocumentTemplatePropertyDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplateProperty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -27,7 +27,7 @@ public class DocumentTemplateService {
|
|||
private final DocumentTemplatePropertiesUpdateRequestConverter documentTemplatePropertiesUpdateRequestConverter;
|
||||
|
||||
public DocumentTemplatePropertiesResponse getAllProperties() {
|
||||
List<DocumentTemplatePropertyPojo> properties = documentTemplatePropertyDao.selectAll();
|
||||
List<DocumentTemplateProperty> properties = documentTemplatePropertyDao.selectAll();
|
||||
var propertiesGroupByType = documentTemplatePropertyResponseConverter.of(properties)
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(d -> d.getType()));
|
||||
|
@ -41,7 +41,7 @@ public class DocumentTemplateService {
|
|||
}
|
||||
|
||||
public void updateByType(DocumentTemplatePropertiesUpdateRequest request) {
|
||||
List<DocumentTemplatePropertyPojo> pojoList = documentTemplatePropertiesUpdateRequestConverter.toPojo(request);
|
||||
List<DocumentTemplateProperty> pojoList = documentTemplatePropertiesUpdateRequestConverter.toPojo(request);
|
||||
documentTemplatePropertyDao.batchInsertOnDuplicateKeyUpdateValue(pojoList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,23 +2,23 @@ package com.databasir.core.domain.group.converter;
|
|||
|
||||
import com.databasir.core.domain.group.data.GroupCreateRequest;
|
||||
import com.databasir.core.domain.group.data.GroupUpdateRequest;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface GroupPojoConverter {
|
||||
public interface GroupConverter {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "deleted", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
GroupPojo of(GroupCreateRequest groupCreateRequest);
|
||||
Group of(GroupCreateRequest groupCreateRequest);
|
||||
|
||||
@Mapping(target = "deleted", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
GroupPojo of(GroupUpdateRequest groupUpdateRequest);
|
||||
Group of(GroupUpdateRequest groupUpdateRequest);
|
||||
|
||||
default String nullToEmpty(String description) {
|
||||
return description == null ? "" : description;
|
|
@ -3,8 +3,8 @@ package com.databasir.core.domain.group.converter;
|
|||
import com.databasir.core.domain.group.data.GroupMemberPageResponse;
|
||||
import com.databasir.core.domain.group.data.GroupPageResponse;
|
||||
import com.databasir.core.domain.group.data.GroupResponse;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.value.GroupMemberDetailPojo;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.stream.Collectors;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface GroupResponseConverter {
|
||||
|
||||
default List<GroupPageResponse> toResponse(List<GroupPojo> pojos,
|
||||
default List<GroupPageResponse> toResponse(List<Group> pojos,
|
||||
Map<Integer, List<String>> groupOwnerGroupByGroupId,
|
||||
Map<Integer, Integer> projectCountMapByGroupId) {
|
||||
return pojos.stream()
|
||||
|
@ -29,11 +29,11 @@ public interface GroupResponseConverter {
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
GroupPageResponse toResponse(GroupPojo groupPojo,
|
||||
GroupPageResponse toResponse(Group group,
|
||||
List<String> groupOwnerNames,
|
||||
Integer projectCount);
|
||||
|
||||
GroupResponse toResponse(GroupPojo groupPojo, List<UserPojo> groupOwners);
|
||||
GroupResponse toResponse(Group group, List<User> groupOwners);
|
||||
|
||||
GroupMemberPageResponse toResponse(GroupMemberDetailPojo data);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.group.service;
|
||||
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.domain.group.converter.GroupPojoConverter;
|
||||
import com.databasir.core.domain.group.converter.GroupConverter;
|
||||
import com.databasir.core.domain.group.converter.GroupResponseConverter;
|
||||
import com.databasir.core.domain.group.data.*;
|
||||
import com.databasir.core.domain.group.event.GroupCreated;
|
||||
|
@ -9,9 +9,9 @@ import com.databasir.core.domain.group.event.GroupDeleted;
|
|||
import com.databasir.core.domain.group.event.GroupUpdated;
|
||||
import com.databasir.core.infrastructure.event.EventPublisher;
|
||||
import com.databasir.dao.impl.*;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import com.databasir.dao.value.GroupMemberSimplePojo;
|
||||
import com.databasir.dao.value.GroupProjectCountPojo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
@ -42,18 +42,18 @@ public class GroupService {
|
|||
|
||||
private final ProjectSyncRuleDao projectSyncRuleDao;
|
||||
|
||||
private final GroupPojoConverter groupPojoConverter;
|
||||
private final GroupConverter groupConverter;
|
||||
|
||||
private final GroupResponseConverter groupResponseConverter;
|
||||
|
||||
@Transactional
|
||||
public Integer create(GroupCreateRequest request) {
|
||||
GroupPojo groupPojo = groupPojoConverter.of(request);
|
||||
Integer groupId = groupDao.insertAndReturnId(groupPojo);
|
||||
List<UserRolePojo> roles = request.getGroupOwnerUserIds()
|
||||
Group group = groupConverter.of(request);
|
||||
Integer groupId = groupDao.insertAndReturnId(group);
|
||||
List<UserRole> roles = request.getGroupOwnerUserIds()
|
||||
.stream()
|
||||
.map(userId -> {
|
||||
UserRolePojo role = new UserRolePojo();
|
||||
UserRole role = new UserRole();
|
||||
role.setUserId(userId);
|
||||
role.setRole(GROUP_OWNER);
|
||||
role.setGroupId(groupId);
|
||||
|
@ -67,16 +67,16 @@ public class GroupService {
|
|||
|
||||
@Transactional
|
||||
public void update(GroupUpdateRequest request) {
|
||||
GroupPojo groupPojo = groupPojoConverter.of(request);
|
||||
groupDao.updateById(groupPojo);
|
||||
userRoleDao.deleteByRoleAndGroupId(GROUP_OWNER, groupPojo.getId());
|
||||
List<UserRolePojo> roles = request.getGroupOwnerUserIds()
|
||||
Group group = groupConverter.of(request);
|
||||
groupDao.updateById(group);
|
||||
userRoleDao.deleteByRoleAndGroupId(GROUP_OWNER, group.getId());
|
||||
List<UserRole> roles = request.getGroupOwnerUserIds()
|
||||
.stream()
|
||||
.map(userId -> {
|
||||
UserRolePojo role = new UserRolePojo();
|
||||
UserRole role = new UserRole();
|
||||
role.setUserId(userId);
|
||||
role.setRole(GROUP_OWNER);
|
||||
role.setGroupId(groupPojo.getId());
|
||||
role.setGroupId(group.getId());
|
||||
return role;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
@ -94,10 +94,10 @@ public class GroupService {
|
|||
}
|
||||
|
||||
public Page<GroupPageResponse> list(Pageable pageable, GroupPageCondition condition) {
|
||||
Page<GroupPojo> page = groupDao.selectByPage(pageable, condition.toCondition());
|
||||
Page<Group> page = groupDao.selectByPage(pageable, condition.toCondition());
|
||||
List<Integer> groupIdList = page.getContent()
|
||||
.stream()
|
||||
.map(GroupPojo::getId)
|
||||
.map(Group::getId)
|
||||
.collect(Collectors.toList());
|
||||
var ownersGroupByGroupId = userRoleDao.selectOwnerNamesByGroupIdIn(groupIdList)
|
||||
.stream()
|
||||
|
@ -105,15 +105,15 @@ public class GroupService {
|
|||
var projectCountMapByGroupId = projectDao.selectCountByGroupIds(groupIdList)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(GroupProjectCountPojo::getGroupId, v -> v));
|
||||
return page.map(groupPojo -> {
|
||||
Integer groupId = groupPojo.getId();
|
||||
return page.map(group -> {
|
||||
Integer groupId = group.getId();
|
||||
List<String> owners = ownersGroupByGroupId.getOrDefault(groupId, new ArrayList<>())
|
||||
.stream()
|
||||
.map(GroupMemberSimplePojo::getNickname)
|
||||
.collect(Collectors.toList());
|
||||
GroupProjectCountPojo countPojo = projectCountMapByGroupId.get(groupId);
|
||||
Integer projectCount = countPojo == null ? 0 : countPojo.getCount();
|
||||
return groupResponseConverter.toResponse(groupPojo, owners, projectCount);
|
||||
return groupResponseConverter.toResponse(group, owners, projectCount);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -125,9 +125,9 @@ public class GroupService {
|
|||
}
|
||||
|
||||
public GroupResponse get(Integer groupId) {
|
||||
GroupPojo groupPojo = groupDao.selectById(groupId);
|
||||
List<UserPojo> users = userDao.selectLimitUsersByRoleAndGroup(groupId, GROUP_OWNER, 50);
|
||||
return groupResponseConverter.toResponse(groupPojo, users);
|
||||
Group group = groupDao.selectById(groupId);
|
||||
List<User> users = userDao.selectLimitUsersByRoleAndGroup(groupId, GROUP_OWNER, 50);
|
||||
return groupResponseConverter.toResponse(group, users);
|
||||
}
|
||||
|
||||
public void removeMember(Integer groupId, Integer userId) {
|
||||
|
@ -138,7 +138,7 @@ public class GroupService {
|
|||
if (userRoleDao.hasRole(request.getUserId(), groupId)) {
|
||||
throw DomainErrors.USER_ROLE_DUPLICATE.exception();
|
||||
}
|
||||
UserRolePojo pojo = new UserRolePojo();
|
||||
UserRole pojo = new UserRole();
|
||||
pojo.setGroupId(groupId);
|
||||
pojo.setUserId(request.getUserId());
|
||||
pojo.setRole(request.getRole());
|
||||
|
@ -149,7 +149,7 @@ public class GroupService {
|
|||
if (!userRoleDao.hasRole(userId, groupId, role)) {
|
||||
// TODO 最多 20 个组长
|
||||
userRoleDao.deleteByUserIdAndGroupId(userId, groupId);
|
||||
UserRolePojo pojo = new UserRolePojo();
|
||||
UserRole pojo = new UserRole();
|
||||
pojo.setUserId(userId);
|
||||
pojo.setGroupId(groupId);
|
||||
pojo.setRole(role);
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.databasir.core.domain.log.converter;
|
||||
|
||||
import com.databasir.core.domain.log.data.OperationLogPageResponse;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.OperationLog;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper(componentModel = "spring", uses = JsonConverter.class)
|
||||
public interface OperationLogConverter {
|
||||
|
||||
@Mapping(target = "id", source = "pojo.id")
|
||||
@Mapping(target = "createAt", source = "pojo.createAt")
|
||||
OperationLogPageResponse to(OperationLog pojo,
|
||||
Group involvedGroup,
|
||||
User involvedUser,
|
||||
Project involvedProject);
|
||||
|
||||
default OperationLogPageResponse to(OperationLog operationLog,
|
||||
Map<Integer, Group> groupMapById,
|
||||
Map<Integer, User> userMapById,
|
||||
Map<Integer, Project> projectMapById) {
|
||||
Group group = null;
|
||||
if (operationLog.getInvolvedGroupId() != null) {
|
||||
group = groupMapById.get(operationLog.getInvolvedGroupId());
|
||||
}
|
||||
User user = null;
|
||||
if (operationLog.getInvolvedUserId() != null) {
|
||||
user = userMapById.get(operationLog.getInvolvedUserId());
|
||||
}
|
||||
Project project = null;
|
||||
if (operationLog.getInvolvedProjectId() != null) {
|
||||
project = projectMapById.get(operationLog.getInvolvedProjectId());
|
||||
}
|
||||
return to(operationLog, group, user, project);
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.databasir.core.domain.log.converter;
|
||||
|
||||
import com.databasir.core.domain.log.data.OperationLogPageResponse;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.OperationLogPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper(componentModel = "spring", uses = JsonConverter.class)
|
||||
public interface OperationLogPojoConverter {
|
||||
|
||||
@Mapping(target = "id", source = "pojo.id")
|
||||
@Mapping(target = "createAt", source = "pojo.createAt")
|
||||
OperationLogPageResponse to(OperationLogPojo pojo,
|
||||
GroupPojo involvedGroup,
|
||||
UserPojo involvedUser,
|
||||
ProjectPojo involvedProject);
|
||||
|
||||
default OperationLogPageResponse to(OperationLogPojo operationLogPojo,
|
||||
Map<Integer, GroupPojo> groupMapById,
|
||||
Map<Integer, UserPojo> userMapById,
|
||||
Map<Integer, ProjectPojo> projectMapById) {
|
||||
GroupPojo group = null;
|
||||
if (operationLogPojo.getInvolvedGroupId() != null) {
|
||||
group = groupMapById.get(operationLogPojo.getInvolvedGroupId());
|
||||
}
|
||||
UserPojo user = null;
|
||||
if (operationLogPojo.getInvolvedUserId() != null) {
|
||||
user = userMapById.get(operationLogPojo.getInvolvedUserId());
|
||||
}
|
||||
ProjectPojo project = null;
|
||||
if (operationLogPojo.getInvolvedProjectId() != null) {
|
||||
project = projectMapById.get(operationLogPojo.getInvolvedProjectId());
|
||||
}
|
||||
return to(operationLogPojo, group, user, project);
|
||||
}
|
||||
}
|
|
@ -2,12 +2,12 @@ package com.databasir.core.domain.log.converter;
|
|||
|
||||
import com.databasir.core.domain.log.data.OperationLogRequest;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.OperationLogPojo;
|
||||
import com.databasir.dao.tables.pojos.OperationLog;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper(componentModel = "spring", uses = JsonConverter.class)
|
||||
public interface OperationLogRequestConverter {
|
||||
|
||||
OperationLogPojo toPojo(OperationLogRequest request);
|
||||
OperationLog toPojo(OperationLogRequest request);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.databasir.core.domain.log.service;
|
|||
|
||||
import com.databasir.common.JsonData;
|
||||
import com.databasir.core.domain.log.annotation.AuditLog;
|
||||
import com.databasir.core.domain.log.converter.OperationLogPojoConverter;
|
||||
import com.databasir.core.domain.log.converter.OperationLogConverter;
|
||||
import com.databasir.core.domain.log.converter.OperationLogRequestConverter;
|
||||
import com.databasir.core.domain.log.data.OperationLogPageCondition;
|
||||
import com.databasir.core.domain.log.data.OperationLogPageResponse;
|
||||
|
@ -11,10 +11,10 @@ import com.databasir.dao.impl.GroupDao;
|
|||
import com.databasir.dao.impl.OperationLogDao;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.OperationLogPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.OperationLog;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
@ -42,10 +42,10 @@ public class OperationLogService {
|
|||
|
||||
private final OperationLogRequestConverter operationLogRequestConverter;
|
||||
|
||||
private final OperationLogPojoConverter operationLogPojoConverter;
|
||||
private final OperationLogConverter operationLogConverter;
|
||||
|
||||
public Long save(OperationLogRequest request) {
|
||||
OperationLogPojo pojo = operationLogRequestConverter.toPojo(request);
|
||||
OperationLog pojo = operationLogRequestConverter.toPojo(request);
|
||||
return operationLogDao.insertAndReturnId(pojo);
|
||||
}
|
||||
|
||||
|
@ -62,14 +62,14 @@ public class OperationLogService {
|
|||
.operatorUserId(-1)
|
||||
.operationResponse(result)
|
||||
.build();
|
||||
OperationLogPojo pojo = operationLogRequestConverter.toPojo(log);
|
||||
OperationLog pojo = operationLogRequestConverter.toPojo(log);
|
||||
operationLogDao.insertAndReturnId(pojo);
|
||||
} catch (Exception e) {
|
||||
log.error("保存登录日志失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveLoginLog(UserPojo user, Boolean success, String msg) {
|
||||
public void saveLoginLog(User user, Boolean success, String msg) {
|
||||
try {
|
||||
JsonData result;
|
||||
if (success) {
|
||||
|
@ -88,7 +88,7 @@ public class OperationLogService {
|
|||
.operatorUserId(user.getId())
|
||||
.operationResponse(result)
|
||||
.build();
|
||||
OperationLogPojo pojo = operationLogRequestConverter.toPojo(log);
|
||||
OperationLog pojo = operationLogRequestConverter.toPojo(log);
|
||||
operationLogDao.insertAndReturnId(pojo);
|
||||
} catch (Exception e) {
|
||||
log.error("保存登录日志失败", e);
|
||||
|
@ -97,27 +97,27 @@ public class OperationLogService {
|
|||
|
||||
public Page<OperationLogPageResponse> list(Pageable page,
|
||||
OperationLogPageCondition condition) {
|
||||
Page<OperationLogPojo> pojoData = operationLogDao.selectByPage(page, condition.toCondition());
|
||||
Page<OperationLog> pojoData = operationLogDao.selectByPage(page, condition.toCondition());
|
||||
List<Integer> groupIds = pojoData.filter(p -> p.getInvolvedGroupId() != null)
|
||||
.map(OperationLogPojo::getInvolvedGroupId)
|
||||
.map(OperationLog::getInvolvedGroupId)
|
||||
.toList();
|
||||
Map<Integer, GroupPojo> groupMapById = groupDao.selectAllInIds(groupIds)
|
||||
Map<Integer, Group> groupMapById = groupDao.selectAllInIds(groupIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(GroupPojo::getId, Function.identity()));
|
||||
.collect(Collectors.toMap(Group::getId, Function.identity()));
|
||||
|
||||
List<Integer> userIds = pojoData.filter(p -> p.getInvolvedUserId() != null)
|
||||
.map(OperationLogPojo::getInvolvedUserId)
|
||||
.map(OperationLog::getInvolvedUserId)
|
||||
.toList();
|
||||
Map<Integer, UserPojo> userMapById = userDao.selectInIds(userIds)
|
||||
Map<Integer, User> userMapById = userDao.selectInIds(userIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(UserPojo::getId, Function.identity()));
|
||||
.collect(Collectors.toMap(User::getId, Function.identity()));
|
||||
|
||||
List<Integer> projectIds = pojoData.filter(p -> p.getInvolvedProjectId() != null)
|
||||
.map(OperationLogPojo::getInvolvedProjectId)
|
||||
.map(OperationLog::getInvolvedProjectId)
|
||||
.toList();
|
||||
Map<Integer, ProjectPojo> projectMapById = projectDao.selectInIds(projectIds)
|
||||
Map<Integer, Project> projectMapById = projectDao.selectInIds(projectIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ProjectPojo::getId, Function.identity()));
|
||||
return pojoData.map(pojo -> operationLogPojoConverter.to(pojo, groupMapById, userMapById, projectMapById));
|
||||
.collect(Collectors.toMap(Project::getId, Function.identity()));
|
||||
return pojoData.map(pojo -> operationLogConverter.to(pojo, groupMapById, userMapById, projectMapById));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ import com.databasir.core.infrastructure.jwt.JwtTokens;
|
|||
import com.databasir.dao.impl.LoginDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.LoginPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.Login;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -39,7 +39,7 @@ public class LoginService {
|
|||
private final JwtTokens jwtTokens;
|
||||
|
||||
public AccessTokenRefreshResponse refreshAccessTokens(AccessTokenRefreshRequest request) {
|
||||
LoginPojo login = loginDao.selectByRefreshToken(request.getRefreshToken())
|
||||
Login login = loginDao.selectByRefreshToken(request.getRefreshToken())
|
||||
.orElseThrow(DomainErrors.INVALID_REFRESH_TOKEN_OPERATION::exception);
|
||||
// refresh-token 已过期
|
||||
if (login.getRefreshTokenExpireAt().isBefore(LocalDateTime.now())) {
|
||||
|
@ -54,7 +54,7 @@ public class LoginService {
|
|||
}
|
||||
|
||||
// refresh-token 对应的用户已被删除
|
||||
UserPojo user = userDao.selectOptionalById(login.getUserId())
|
||||
User user = userDao.selectOptionalById(login.getUserId())
|
||||
.orElseThrow(() -> {
|
||||
log.warn("user not exists but refresh token exists for " + login.getRefreshToken());
|
||||
return DomainErrors.INVALID_REFRESH_TOKEN_OPERATION.exception("invalid user");
|
||||
|
@ -72,19 +72,19 @@ public class LoginService {
|
|||
}
|
||||
|
||||
public LoginKeyResponse generate(Integer userId) {
|
||||
UserPojo user = userDao.selectById(userId);
|
||||
User user = userDao.selectById(userId);
|
||||
String accessToken = jwtTokens.accessToken(user.getEmail());
|
||||
LocalDateTime accessTokenExpireAt = jwtTokens.expireAt(accessToken);
|
||||
String refreshToken = UUID.randomUUID().toString().replace("-", "");
|
||||
LocalDateTime refreshTokenExpireAt = LocalDateTime.now().plusDays(15);
|
||||
|
||||
LoginPojo loginPojo = new LoginPojo();
|
||||
loginPojo.setAccessToken(accessToken);
|
||||
loginPojo.setAccessTokenExpireAt(accessTokenExpireAt);
|
||||
loginPojo.setRefreshToken(refreshToken);
|
||||
loginPojo.setRefreshTokenExpireAt(refreshTokenExpireAt);
|
||||
loginPojo.setUserId(userId);
|
||||
loginDao.insertOnDuplicateKeyUpdate(loginPojo);
|
||||
Login login = new Login();
|
||||
login.setAccessToken(accessToken);
|
||||
login.setAccessTokenExpireAt(accessTokenExpireAt);
|
||||
login.setRefreshToken(refreshToken);
|
||||
login.setRefreshTokenExpireAt(refreshTokenExpireAt);
|
||||
login.setUserId(userId);
|
||||
loginDao.insertOnDuplicateKeyUpdate(login);
|
||||
|
||||
return LoginKeyResponse.builder()
|
||||
.userId(userId)
|
||||
|
@ -98,7 +98,7 @@ public class LoginService {
|
|||
public Optional<UserLoginResponse> getUserLoginData(Integer userId) {
|
||||
return loginDao.selectByUserId(userId)
|
||||
.map(login -> {
|
||||
UserPojo user = userDao.selectById(login.getUserId());
|
||||
User user = userDao.selectById(login.getUserId());
|
||||
UserLoginResponse data = new UserLoginResponse();
|
||||
data.setId(user.getId());
|
||||
data.setNickname(user.getNickname());
|
||||
|
@ -110,7 +110,7 @@ public class LoginService {
|
|||
.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
|
||||
data.setAccessTokenExpireAt(expireAt);
|
||||
data.setRefreshToken(login.getRefreshToken());
|
||||
List<UserRolePojo> rolePojoList =
|
||||
List<UserRole> rolePojoList =
|
||||
userRoleDao.selectByUserIds(Collections.singletonList(user.getId()));
|
||||
List<UserLoginResponse.RoleResponse> roles = rolePojoList
|
||||
.stream()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.databasir.core.domain.mock;
|
||||
|
||||
import com.databasir.core.domain.mock.converter.MockDataRulePojoConverter;
|
||||
import com.databasir.core.domain.mock.converter.MockDataRuleConverter;
|
||||
import com.databasir.core.domain.mock.converter.MockDataRuleResponseConverter;
|
||||
import com.databasir.core.domain.mock.data.ColumnMockRuleSaveRequest;
|
||||
import com.databasir.core.domain.mock.data.MockDataGenerateCondition;
|
||||
|
@ -12,10 +12,10 @@ import com.databasir.core.domain.mock.validator.MockDataValidator;
|
|||
import com.databasir.dao.enums.MockDataType;
|
||||
import com.databasir.dao.impl.MockDataRuleDao;
|
||||
import com.databasir.dao.impl.TableColumnDocumentDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.MockDataRulePojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocument;
|
||||
import com.databasir.dao.tables.pojos.MockDataRule;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import com.databasir.dao.tables.pojos.TableDocument;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class MockDataService {
|
|||
|
||||
private final TableColumnDocumentDao tableColumnDocumentDao;
|
||||
|
||||
private final MockDataRulePojoConverter mockDataRulePojoConverter;
|
||||
private final MockDataRuleConverter mockDataRuleConverter;
|
||||
|
||||
private final MockDataRuleResponseConverter mockDataRuleResponseConverter;
|
||||
|
||||
|
@ -43,10 +43,10 @@ public class MockDataService {
|
|||
|
||||
public String generateMockInsertSql(Integer projectId, MockDataGenerateCondition condition) {
|
||||
mockDataValidator.validProject(projectId);
|
||||
DatabaseDocumentPojo databaseDoc =
|
||||
mockDataValidator.validAndGetDatabaseDocumentPojo(projectId, condition.getVersion());
|
||||
TableDocumentPojo tableDoc =
|
||||
mockDataValidator.validAndGetTableDocumentPojo(databaseDoc.getId(), condition.getTableId());
|
||||
DatabaseDocument databaseDoc =
|
||||
mockDataValidator.validAndGetDatabaseDocument(projectId, condition.getVersion());
|
||||
TableDocument tableDoc =
|
||||
mockDataValidator.validAndGetTableDocument(databaseDoc.getId(), condition.getTableId());
|
||||
return mockDataGenerator.createInsertSql(projectId, databaseDoc.getId(), tableDoc.getName());
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ public class MockDataService {
|
|||
Integer tableId,
|
||||
List<ColumnMockRuleSaveRequest> rules) {
|
||||
mockDataValidator.validProject(projectId);
|
||||
DatabaseDocumentPojo doc =
|
||||
mockDataValidator.validAndGetDatabaseDocumentPojo(projectId, null);
|
||||
TableDocumentPojo tableDoc =
|
||||
mockDataValidator.validAndGetTableDocumentPojo(doc.getId(), tableId);
|
||||
DatabaseDocument doc =
|
||||
mockDataValidator.validAndGetDatabaseDocument(projectId, null);
|
||||
TableDocument tableDoc =
|
||||
mockDataValidator.validAndGetTableDocument(doc.getId(), tableId);
|
||||
List<String> columnNames = rules.stream()
|
||||
.map(ColumnMockRuleSaveRequest::getColumnName)
|
||||
.collect(Collectors.toList());
|
||||
|
@ -67,21 +67,21 @@ public class MockDataService {
|
|||
// verify
|
||||
mockDataGenerator.createInsertSql(projectId, doc.getId(), tableDoc.getName());
|
||||
|
||||
List<MockDataRulePojo> pojo = mockDataRulePojoConverter.from(projectId, rules);
|
||||
List<MockDataRule> pojo = mockDataRuleConverter.from(projectId, rules);
|
||||
mockDataRuleDao.batchSave(pojo);
|
||||
}
|
||||
|
||||
public List<MockDataRuleResponse> listRules(Integer projectId, MockDataRuleListCondition condition) {
|
||||
mockDataValidator.validProject(projectId);
|
||||
DatabaseDocumentPojo databaseDoc =
|
||||
mockDataValidator.validAndGetDatabaseDocumentPojo(projectId, condition.getVersion());
|
||||
TableDocumentPojo tableDoc =
|
||||
mockDataValidator.validAndGetTableDocumentPojo(databaseDoc.getId(), condition.getTableId());
|
||||
List<TableColumnDocumentPojo> columns =
|
||||
DatabaseDocument databaseDoc =
|
||||
mockDataValidator.validAndGetDatabaseDocument(projectId, condition.getVersion());
|
||||
TableDocument tableDoc =
|
||||
mockDataValidator.validAndGetTableDocument(databaseDoc.getId(), condition.getTableId());
|
||||
List<TableColumnDocument> columns =
|
||||
tableColumnDocumentDao.selectByTableDocumentId(condition.getTableId());
|
||||
var ruleMapByColumnName = mockDataRuleDao.selectByProjectIdAndTableName(projectId, tableDoc.getName())
|
||||
.stream()
|
||||
.collect(Collectors.toMap(MockDataRulePojo::getColumnName, Function.identity()));
|
||||
.collect(Collectors.toMap(MockDataRule::getColumnName, Function.identity()));
|
||||
return columns.stream()
|
||||
.map(col -> {
|
||||
if (ruleMapByColumnName.containsKey(col.getName())) {
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package com.databasir.core.domain.mock.converter;
|
||||
|
||||
import com.databasir.core.domain.mock.data.ColumnMockRuleSaveRequest;
|
||||
import com.databasir.dao.tables.pojos.MockDataRulePojo;
|
||||
import com.databasir.dao.tables.pojos.MockDataRule;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface MockDataRulePojoConverter {
|
||||
public interface MockDataRuleConverter {
|
||||
|
||||
MockDataRulePojo from(Integer projectId, ColumnMockRuleSaveRequest request);
|
||||
MockDataRule from(Integer projectId, ColumnMockRuleSaveRequest request);
|
||||
|
||||
default List<MockDataRulePojo> from(Integer projectId, List<ColumnMockRuleSaveRequest> request) {
|
||||
default List<MockDataRule> from(Integer projectId, List<ColumnMockRuleSaveRequest> request) {
|
||||
return request.stream()
|
||||
.map(rule -> from(projectId, rule))
|
||||
.collect(Collectors.toList());
|
|
@ -2,8 +2,8 @@ package com.databasir.core.domain.mock.converter;
|
|||
|
||||
import com.databasir.core.domain.mock.data.MockDataRuleResponse;
|
||||
import com.databasir.dao.enums.MockDataType;
|
||||
import com.databasir.dao.tables.pojos.MockDataRulePojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.MockDataRule;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -11,9 +11,9 @@ import org.mapstruct.Mapping;
|
|||
public interface MockDataRuleResponseConverter {
|
||||
|
||||
@Mapping(target = "columnType", source = "column.type")
|
||||
MockDataRuleResponse from(MockDataRulePojo pojo, TableColumnDocumentPojo column);
|
||||
MockDataRuleResponse from(MockDataRule pojo, TableColumnDocument column);
|
||||
|
||||
@Mapping(target = "columnName", source = "pojo.name")
|
||||
@Mapping(target = "columnType", source = "pojo.type")
|
||||
MockDataRuleResponse from(String tableName, MockDataType mockDataType, TableColumnDocumentPojo pojo);
|
||||
MockDataRuleResponse from(String tableName, MockDataType mockDataType, TableColumnDocument pojo);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.databasir.core.domain.mock.generator;
|
|||
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.dao.exception.DataNotExistsException;
|
||||
import com.databasir.dao.tables.pojos.MockDataRulePojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.MockDataRule;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -29,17 +29,17 @@ public class MockDataContext {
|
|||
private Map<String, Set<String>> toReference = new LinkedHashMap<>();
|
||||
|
||||
@Builder.Default
|
||||
private Map<String, Map<String, MockDataRulePojo>> ruleMap = new LinkedHashMap<>(16);
|
||||
private Map<String, Map<String, MockDataRule>> ruleMap = new LinkedHashMap<>(16);
|
||||
|
||||
@Builder.Default
|
||||
private Map<String, Map<String, TableColumnDocumentPojo>> tableColumnMap = new LinkedHashMap<>(16);
|
||||
private Map<String, Map<String, TableColumnDocument>> tableColumnMap = new LinkedHashMap<>(16);
|
||||
|
||||
@Builder.Default
|
||||
private Map<String, Set<String>> mockInProgress = new HashMap<>();
|
||||
|
||||
public void addTableMockRules(String tableName, List<MockDataRulePojo> rules) {
|
||||
public void addTableMockRules(String tableName, List<MockDataRule> rules) {
|
||||
var columnRuleMap = rules.stream()
|
||||
.collect(Collectors.toMap(MockDataRulePojo::getColumnName, Function.identity()));
|
||||
.collect(Collectors.toMap(MockDataRule::getColumnName, Function.identity()));
|
||||
this.ruleMap.put(tableName, columnRuleMap);
|
||||
}
|
||||
|
||||
|
@ -54,16 +54,16 @@ public class MockDataContext {
|
|||
return ruleMap.get(tableName).containsKey(columnName);
|
||||
}
|
||||
|
||||
public Optional<MockDataRulePojo> getMockRule(String tableName, String columnName) {
|
||||
public Optional<MockDataRule> getMockRule(String tableName, String columnName) {
|
||||
if (!ruleMap.containsKey(tableName)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.ofNullable(ruleMap.get(tableName).get(columnName));
|
||||
}
|
||||
|
||||
public void addTableColumns(String tableName, List<TableColumnDocumentPojo> columns) {
|
||||
Map<String, TableColumnDocumentPojo> columnMap = new LinkedHashMap<>();
|
||||
for (TableColumnDocumentPojo column : columns) {
|
||||
public void addTableColumns(String tableName, List<TableColumnDocument> columns) {
|
||||
Map<String, TableColumnDocument> columnMap = new LinkedHashMap<>();
|
||||
for (TableColumnDocument column : columns) {
|
||||
columnMap.put(column.getName(), column);
|
||||
}
|
||||
this.tableColumnMap.put(tableName, columnMap);
|
||||
|
@ -80,7 +80,7 @@ public class MockDataContext {
|
|||
return tableColumnMap.get(tableName).containsKey(columnName);
|
||||
}
|
||||
|
||||
public TableColumnDocumentPojo getTableColumn(String tableName, String columnName) {
|
||||
public TableColumnDocument getTableColumn(String tableName, String columnName) {
|
||||
if (!tableColumnMap.containsKey(tableName)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import com.databasir.dao.impl.MockDataRuleDao;
|
|||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.TableColumnDocumentDao;
|
||||
import com.databasir.dao.impl.TableDocumentDao;
|
||||
import com.databasir.dao.tables.pojos.MockDataRulePojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.MockDataRule;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -63,7 +63,7 @@ public class MockDataGenerator {
|
|||
context.addTableMockRules(tableName, columnRules);
|
||||
}
|
||||
|
||||
for (TableColumnDocumentPojo column : context.getTableColumnMap().get(tableName).values()) {
|
||||
for (TableColumnDocument column : context.getTableColumnMap().get(tableName).values()) {
|
||||
if (context.containsColumnMockData(tableName, column.getName())
|
||||
|| context.isMockInProgress(tableName, column.getName())) {
|
||||
continue;
|
||||
|
@ -76,11 +76,11 @@ public class MockDataGenerator {
|
|||
if (context.containsColumnMockData(tableName, columnName)) {
|
||||
return;
|
||||
}
|
||||
TableColumnDocumentPojo column = context.getTableColumn(tableName, columnName);
|
||||
Optional<MockDataRulePojo> ruleOption = context.getMockRule(tableName, columnName);
|
||||
TableColumnDocument column = context.getTableColumn(tableName, columnName);
|
||||
Optional<MockDataRule> ruleOption = context.getMockRule(tableName, columnName);
|
||||
String rawData;
|
||||
if (ruleOption.isPresent()) {
|
||||
MockDataRulePojo rule = ruleOption.get();
|
||||
MockDataRule rule = ruleOption.get();
|
||||
if (rule.getMockDataType() == MockDataType.REF) {
|
||||
context.addMockInProgress(tableName, columnName);
|
||||
context.saveReference(
|
||||
|
@ -103,7 +103,7 @@ public class MockDataGenerator {
|
|||
context.addColumnMockData(tableName, toData(rawData, column));
|
||||
}
|
||||
|
||||
private String createByFactory(TableColumnDocumentPojo column, MockDataRulePojo rule) {
|
||||
private String createByFactory(TableColumnDocument column, MockDataRule rule) {
|
||||
MockDataType mockType = rule == null ? MockDataType.AUTO : rule.getMockDataType();
|
||||
MockColumnRule colRule = MockColumnRule.builder()
|
||||
.dataType(column.getDataType())
|
||||
|
@ -119,7 +119,7 @@ public class MockDataGenerator {
|
|||
.orElseThrow();
|
||||
}
|
||||
|
||||
private ColumnMockData toData(String data, TableColumnDocumentPojo column) {
|
||||
private ColumnMockData toData(String data, TableColumnDocument column) {
|
||||
return ColumnMockData.builder()
|
||||
.columnName(column.getName())
|
||||
.columnType(column.getType())
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.databasir.core.domain.mock.script.SpelScriptEvaluator;
|
|||
import com.databasir.dao.enums.MockDataType;
|
||||
import com.databasir.dao.impl.TableColumnDocumentDao;
|
||||
import com.databasir.dao.impl.TableDocumentDao;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableColumnDocument;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class MockDataSaveValidator {
|
|||
public void validTableColumn(Integer tableDocId, List<String> requestColumnNames) {
|
||||
var existsColumnNames = tableColumnDocumentDao.selectByTableDocumentId(tableDocId)
|
||||
.stream()
|
||||
.map(TableColumnDocumentPojo::getName)
|
||||
.map(TableColumnDocument::getName)
|
||||
.collect(Collectors.toSet());
|
||||
for (String colName : requestColumnNames) {
|
||||
if (!existsColumnNames.contains(colName)) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.databasir.core.domain.DomainErrors;
|
|||
import com.databasir.dao.impl.DatabaseDocumentDao;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.TableDocumentDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.TableDocumentPojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseDocument;
|
||||
import com.databasir.dao.tables.pojos.TableDocument;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -27,8 +27,8 @@ public class MockDataValidator {
|
|||
}
|
||||
}
|
||||
|
||||
public DatabaseDocumentPojo validAndGetDatabaseDocumentPojo(Integer projectId, Long version) {
|
||||
Optional<DatabaseDocumentPojo> databaseDoc;
|
||||
public DatabaseDocument validAndGetDatabaseDocument(Integer projectId, Long version) {
|
||||
Optional<DatabaseDocument> databaseDoc;
|
||||
if (version == null) {
|
||||
databaseDoc = databaseDocumentDao.selectNotArchivedByProjectId(projectId);
|
||||
} else {
|
||||
|
@ -40,8 +40,8 @@ public class MockDataValidator {
|
|||
return databaseDoc.get();
|
||||
}
|
||||
|
||||
public TableDocumentPojo validAndGetTableDocumentPojo(Integer databaseDocId, Integer tableId) {
|
||||
Optional<TableDocumentPojo> tableOption =
|
||||
public TableDocument validAndGetTableDocument(Integer databaseDocId, Integer tableId) {
|
||||
Optional<TableDocument> tableOption =
|
||||
tableDocumentDao.selectByDatabaseDocumentIdAndId(databaseDocId, tableId);
|
||||
if (tableOption.isEmpty()) {
|
||||
throw DomainErrors.DATABASE_META_NOT_FOUND.exception("表数据不存在");
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.databasir.core.domain.project.converter;
|
|||
import com.databasir.core.domain.project.data.DataSourcePropertyValue;
|
||||
import com.databasir.core.domain.project.data.ProjectCreateRequest;
|
||||
import com.databasir.core.domain.project.data.ProjectUpdateRequest;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePojo;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.DataSource;
|
||||
import com.databasir.dao.tables.pojos.DataSourceProperty;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -12,28 +12,28 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface DataSourcePojoConverter {
|
||||
public interface DataSourceConverter {
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
@Mapping(target = "password", source = "password")
|
||||
DataSourcePojo of(ProjectCreateRequest.DataSourceCreateRequest request,
|
||||
DataSource of(ProjectCreateRequest.DataSourceCreateRequest request,
|
||||
String password,
|
||||
Integer projectId);
|
||||
|
||||
@Mapping(target = "updateAt", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
@Mapping(target = "password", source = "password")
|
||||
DataSourcePojo of(ProjectUpdateRequest.DataSourceUpdateRequest request,
|
||||
DataSource of(ProjectUpdateRequest.DataSourceUpdateRequest request,
|
||||
String password,
|
||||
Integer projectId);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
@Mapping(target = "createAt", ignore = true)
|
||||
DataSourcePropertyPojo of(DataSourcePropertyValue propertyValues, Integer dataSourceId);
|
||||
DataSourceProperty of(DataSourcePropertyValue propertyValues, Integer dataSourceId);
|
||||
|
||||
default List<DataSourcePropertyPojo> of(List<DataSourcePropertyValue> propertyValues,
|
||||
default List<DataSourceProperty> of(List<DataSourcePropertyValue> propertyValues,
|
||||
Integer dataSourceId) {
|
||||
return propertyValues.stream().map(value -> of(value, dataSourceId)).collect(Collectors.toList());
|
||||
}
|
|
@ -3,8 +3,8 @@ package com.databasir.core.domain.project.converter;
|
|||
import com.databasir.core.domain.project.data.ProjectCreateRequest;
|
||||
import com.databasir.core.domain.project.data.ProjectUpdateRequest;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRulePojo;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRule;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
@ -12,20 +12,20 @@ import org.mapstruct.ReportingPolicy;
|
|||
import java.util.Optional;
|
||||
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = JsonConverter.class)
|
||||
public interface ProjectPojoConverter {
|
||||
public interface ProjectConverter {
|
||||
|
||||
ProjectPojo of(ProjectCreateRequest request);
|
||||
Project of(ProjectCreateRequest request);
|
||||
|
||||
ProjectPojo of(ProjectUpdateRequest request);
|
||||
Project of(ProjectUpdateRequest request);
|
||||
|
||||
@Mapping(target = "ignoreTableNameRegexArray", source = "request.ignoreTableNameRegexes")
|
||||
@Mapping(target = "ignoreColumnNameRegexArray", source = "request.ignoreColumnNameRegexes")
|
||||
ProjectSyncRulePojo of(ProjectCreateRequest.ProjectSyncRuleCreateRequest request,
|
||||
ProjectSyncRule of(ProjectCreateRequest.ProjectSyncRuleCreateRequest request,
|
||||
Integer projectId);
|
||||
|
||||
@Mapping(target = "ignoreTableNameRegexArray", source = "request.ignoreTableNameRegexes")
|
||||
@Mapping(target = "ignoreColumnNameRegexArray", source = "request.ignoreColumnNameRegexes")
|
||||
ProjectSyncRulePojo of(ProjectUpdateRequest.ProjectSyncRuleUpdateRequest request,
|
||||
ProjectSyncRule of(ProjectUpdateRequest.ProjectSyncRuleUpdateRequest request,
|
||||
Integer projectId);
|
||||
|
||||
default String optionToEmpty(Optional<String> optional) {
|
|
@ -3,10 +3,10 @@ package com.databasir.core.domain.project.converter;
|
|||
import com.databasir.core.domain.project.data.ProjectDetailResponse;
|
||||
import com.databasir.core.domain.project.data.ProjectSimpleResponse;
|
||||
import com.databasir.core.infrastructure.converter.JsonConverter;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePojo;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRulePojo;
|
||||
import com.databasir.dao.tables.pojos.DataSource;
|
||||
import com.databasir.dao.tables.pojos.DataSourceProperty;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRule;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
@ -18,21 +18,21 @@ public interface ProjectResponseConverter {
|
|||
|
||||
@Mapping(target = "id", source = "database.id")
|
||||
@Mapping(target = "createAt", source = "database.createAt")
|
||||
ProjectDetailResponse toResponse(ProjectPojo database,
|
||||
ProjectDetailResponse toResponse(Project database,
|
||||
ProjectDetailResponse.DataSourceResponse dataSource,
|
||||
ProjectDetailResponse.ProjectSyncRuleResponse projectSyncRule);
|
||||
|
||||
ProjectDetailResponse.DataSourceResponse toResponse(DataSourcePojo dataSource,
|
||||
List<DataSourcePropertyPojo> properties);
|
||||
ProjectDetailResponse.DataSourceResponse toResponse(DataSource dataSource,
|
||||
List<DataSourceProperty> properties);
|
||||
|
||||
@Mapping(target = "ignoreTableNameRegexes", source = "ignoreTableNameRegexArray")
|
||||
@Mapping(target = "ignoreColumnNameRegexes", source = "ignoreColumnNameRegexArray")
|
||||
ProjectDetailResponse.ProjectSyncRuleResponse toResponse(ProjectSyncRulePojo rule);
|
||||
ProjectDetailResponse.ProjectSyncRuleResponse toResponse(ProjectSyncRule rule);
|
||||
|
||||
@Mapping(target = "id", source = "project.id")
|
||||
@Mapping(target = "createAt", source = "project.createAt")
|
||||
ProjectSimpleResponse toSimple(ProjectPojo project,
|
||||
DataSourcePojo dataSource,
|
||||
ProjectSyncRulePojo syncRule,
|
||||
ProjectSimpleResponse toSimple(Project project,
|
||||
DataSource dataSource,
|
||||
ProjectSyncRule syncRule,
|
||||
Boolean isFavorite);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.project.converter;
|
||||
|
||||
import com.databasir.core.domain.project.data.task.ProjectSimpleTaskResponse;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncTaskPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncTask;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -10,8 +10,8 @@ import java.util.List;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface ProjectSimpleTaskResponseConverter {
|
||||
|
||||
List<ProjectSimpleTaskResponse> of(List<ProjectSyncTaskPojo> pojos);
|
||||
List<ProjectSimpleTaskResponse> of(List<ProjectSyncTask> pojos);
|
||||
|
||||
@Mapping(target = "taskId", source = "id")
|
||||
ProjectSimpleTaskResponse of(ProjectSyncTaskPojo pojo);
|
||||
ProjectSimpleTaskResponse of(ProjectSyncTask pojo);
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.databasir.core.domain.project.service;
|
|||
|
||||
import com.databasir.common.codec.Aes;
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.domain.project.converter.DataSourcePojoConverter;
|
||||
import com.databasir.core.domain.project.converter.ProjectPojoConverter;
|
||||
import com.databasir.core.domain.project.converter.DataSourceConverter;
|
||||
import com.databasir.core.domain.project.converter.ProjectConverter;
|
||||
import com.databasir.core.domain.project.converter.ProjectResponseConverter;
|
||||
import com.databasir.core.domain.project.converter.ProjectSimpleTaskResponseConverter;
|
||||
import com.databasir.core.domain.project.data.*;
|
||||
|
@ -50,9 +50,9 @@ public class ProjectService {
|
|||
|
||||
private final ProjectSyncTaskDao projectSyncTaskDao;
|
||||
|
||||
private final DataSourcePojoConverter dataSourcePojoConverter;
|
||||
private final DataSourceConverter dataSourceConverter;
|
||||
|
||||
private final ProjectPojoConverter projectPojoConverter;
|
||||
private final ProjectConverter projectConverter;
|
||||
|
||||
private final ProjectResponseConverter projectResponseConverter;
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class ProjectService {
|
|||
|
||||
@Transactional
|
||||
public Integer create(ProjectCreateRequest request) {
|
||||
ProjectPojo project = projectPojoConverter.of(request);
|
||||
Project project = projectConverter.of(request);
|
||||
Integer projectId = null;
|
||||
try {
|
||||
projectId = projectDao.insertAndReturnId(project);
|
||||
|
@ -84,14 +84,14 @@ public class ProjectService {
|
|||
}
|
||||
|
||||
String newPassword = encryptPassword(request.getDataSource().getPassword()).get();
|
||||
DataSourcePojo dataSource = dataSourcePojoConverter.of(request.getDataSource(), newPassword, projectId);
|
||||
DataSource dataSource = dataSourceConverter.of(request.getDataSource(), newPassword, projectId);
|
||||
Integer dataSourceId = dataSourceDao.insertAndReturnId(dataSource);
|
||||
|
||||
List<DataSourcePropertyValue> propertyValues = request.getDataSource().getProperties();
|
||||
List<DataSourcePropertyPojo> properties = dataSourcePojoConverter.of(propertyValues, dataSourceId);
|
||||
List<DataSourceProperty> properties = dataSourceConverter.of(propertyValues, dataSourceId);
|
||||
dataSourcePropertyDao.batchInsert(properties);
|
||||
|
||||
ProjectSyncRulePojo syncRule = projectPojoConverter.of(request.getProjectSyncRule(), projectId);
|
||||
ProjectSyncRule syncRule = projectConverter.of(request.getProjectSyncRule(), projectId);
|
||||
projectSyncRuleDao.insertAndReturnId(syncRule);
|
||||
|
||||
var event = ProjectSaved.builder()
|
||||
|
@ -113,13 +113,13 @@ public class ProjectService {
|
|||
if (projectDao.exists(groupId, projectId)) {
|
||||
// update dataSource
|
||||
String newPassword = encryptPassword(request.getDataSource().getPassword()).orElse(null);
|
||||
DataSourcePojo dataSource = dataSourcePojoConverter.of(request.getDataSource(), newPassword, projectId);
|
||||
DataSource dataSource = dataSourceConverter.of(request.getDataSource(), newPassword, projectId);
|
||||
dataSourceDao.updateByProjectId(dataSource);
|
||||
|
||||
// update connection property
|
||||
Integer dataSourceId = dataSourceDao.selectByProjectId(projectId).getId();
|
||||
List<DataSourcePropertyValue> propertyValues = request.getDataSource().getProperties();
|
||||
List<DataSourcePropertyPojo> properties = dataSourcePojoConverter.of(propertyValues, dataSourceId);
|
||||
List<DataSourceProperty> properties = dataSourceConverter.of(propertyValues, dataSourceId);
|
||||
if (properties.isEmpty()) {
|
||||
dataSourcePropertyDao.deleteByDataSourceId(dataSourceId);
|
||||
} else {
|
||||
|
@ -128,12 +128,12 @@ public class ProjectService {
|
|||
}
|
||||
|
||||
// update project sync rule
|
||||
ProjectSyncRulePojo syncRule = projectPojoConverter.of(request.getProjectSyncRule(), projectId);
|
||||
ProjectSyncRule syncRule = projectConverter.of(request.getProjectSyncRule(), projectId);
|
||||
projectSyncRuleDao.deleteByProjectId(projectId);
|
||||
projectSyncRuleDao.insertAndReturnId(syncRule);
|
||||
|
||||
// update project info
|
||||
ProjectPojo project = projectPojoConverter.of(request);
|
||||
Project project = projectConverter.of(request);
|
||||
projectDao.updateById(project);
|
||||
|
||||
ProjectSaved event = ProjectSaved.builder()
|
||||
|
@ -155,7 +155,7 @@ public class ProjectService {
|
|||
if (!StringUtils.hasText(password)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
SysKeyPojo sysKey = sysKeyDao.selectTopOne();
|
||||
SysKey sysKey = sysKeyDao.selectTopOne();
|
||||
// String decryptedPassword = Rsa.decryptFromBase64DataByPrivateKey(password, sysKey.getRsaPrivateKey());
|
||||
return Optional.of(Aes.encryptToBase64Data(password, sysKey.getAesKey()));
|
||||
}
|
||||
|
@ -168,24 +168,24 @@ public class ProjectService {
|
|||
}
|
||||
|
||||
public Page<ProjectSimpleResponse> list(Integer userId, Pageable page, ProjectListCondition condition) {
|
||||
Page<ProjectPojo> pageData = projectDao.selectByCondition(page, condition.toCondition());
|
||||
Page<Project> pageData = projectDao.selectByCondition(page, condition.toCondition());
|
||||
List<Integer> projectIds = pageData.getContent()
|
||||
.stream()
|
||||
.map(ProjectPojo::getId)
|
||||
.map(Project::getId)
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, DataSourcePojo> dataSourceMapByProjectId = dataSourceDao.selectInProjectIds(projectIds)
|
||||
Map<Integer, DataSource> dataSourceMapByProjectId = dataSourceDao.selectInProjectIds(projectIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(DataSourcePojo::getProjectId, Function.identity()));
|
||||
Map<Integer, ProjectSyncRulePojo> syncRuleMapByProjectId = projectSyncRuleDao.selectInProjectIds(projectIds)
|
||||
.collect(Collectors.toMap(DataSource::getProjectId, Function.identity()));
|
||||
Map<Integer, ProjectSyncRule> syncRuleMapByProjectId = projectSyncRuleDao.selectInProjectIds(projectIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ProjectSyncRulePojo::getProjectId, Function.identity()));
|
||||
.collect(Collectors.toMap(ProjectSyncRule::getProjectId, Function.identity()));
|
||||
Set<Integer> favoriteProjectIds = userFavoriteProjectDao.selectByUserIdAndProjectIds(userId, projectIds)
|
||||
.stream()
|
||||
.map(UserFavoriteProjectPojo::getProjectId)
|
||||
.map(UserFavoriteProject::getProjectId)
|
||||
.collect(Collectors.toSet());
|
||||
return pageData.map(project -> {
|
||||
DataSourcePojo dataSource = dataSourceMapByProjectId.get(project.getId());
|
||||
ProjectSyncRulePojo syncRule = syncRuleMapByProjectId.get(project.getId());
|
||||
DataSource dataSource = dataSourceMapByProjectId.get(project.getId());
|
||||
ProjectSyncRule syncRule = syncRuleMapByProjectId.get(project.getId());
|
||||
Boolean isFavorite = favoriteProjectIds.contains(project.getId());
|
||||
return projectResponseConverter.toSimple(project, dataSource, syncRule, isFavorite);
|
||||
});
|
||||
|
@ -194,8 +194,8 @@ public class ProjectService {
|
|||
public void testConnection(ProjectTestConnectionRequest request) {
|
||||
String password;
|
||||
if (request.getProjectId() != null && !StringUtils.hasText(request.getPassword())) {
|
||||
DataSourcePojo dataSource = dataSourceDao.selectByProjectId(request.getProjectId());
|
||||
SysKeyPojo sysKey = sysKeyDao.selectTopOne();
|
||||
DataSource dataSource = dataSourceDao.selectByProjectId(request.getProjectId());
|
||||
SysKey sysKey = sysKeyDao.selectTopOne();
|
||||
password = Aes.decryptFromBase64Data(dataSource.getPassword(), sysKey.getAesKey());
|
||||
} else if (StringUtils.hasText(request.getPassword())) {
|
||||
password = request.getPassword();
|
||||
|
@ -224,7 +224,7 @@ public class ProjectService {
|
|||
log.warn("create sync task failed, it's already exists, projectId={}", projectId);
|
||||
return Optional.empty();
|
||||
}
|
||||
ProjectSyncTaskPojo projectSyncTask = new ProjectSyncTaskPojo();
|
||||
ProjectSyncTask projectSyncTask = new ProjectSyncTask();
|
||||
projectSyncTask.setProjectId(projectId);
|
||||
projectSyncTask.setStatus(ProjectSyncTaskStatus.NEW);
|
||||
projectSyncTask.setUserId(userId);
|
||||
|
|
|
@ -5,9 +5,9 @@ import com.databasir.core.domain.search.data.SearchResponse;
|
|||
import com.databasir.dao.impl.DocumentFullTextDao;
|
||||
import com.databasir.dao.impl.GroupDao;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullTextPojo;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullText;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
@ -31,8 +31,8 @@ public class SearchService {
|
|||
private final ProjectDao projectDao;
|
||||
|
||||
public SearchResponse search(Pageable pageable, String query) {
|
||||
Page<DocumentFullTextPojo> columnPageData = documentFullTextDao.selectColumnPage(pageable, query);
|
||||
Page<DocumentFullTextPojo> tablePageData = documentFullTextDao.selectTablePage(pageable, query);
|
||||
Page<DocumentFullText> columnPageData = documentFullTextDao.selectColumnPage(pageable, query);
|
||||
Page<DocumentFullText> tablePageData = documentFullTextDao.selectTablePage(pageable, query);
|
||||
|
||||
// table 和 column 的项目名、组名等信息需要从关联表取
|
||||
Set<Integer> projectIds = new HashSet<>();
|
||||
|
@ -40,11 +40,11 @@ public class SearchService {
|
|||
.stream().map(o -> o.getProjectId()).collect(Collectors.toList()));
|
||||
projectIds.addAll(tablePageData.getContent()
|
||||
.stream().map(o -> o.getProjectId()).collect(Collectors.toList()));
|
||||
Map<Integer, ProjectPojo> projectMapById = projectDao.selectInIds(projectIds)
|
||||
Map<Integer, Project> projectMapById = projectDao.selectInIds(projectIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(o -> o.getId(), o -> o));
|
||||
|
||||
Page<DocumentFullTextPojo> projectPageData = documentFullTextDao.selectProjectPage(pageable, query);
|
||||
Page<DocumentFullText> projectPageData = documentFullTextDao.selectProjectPage(pageable, query);
|
||||
Set<Integer> groupIds = new HashSet<>();
|
||||
groupIds.addAll(columnPageData.getContent()
|
||||
.stream().map(o -> o.getGroupId()).collect(Collectors.toList()));
|
||||
|
@ -52,7 +52,7 @@ public class SearchService {
|
|||
.stream().map(o -> o.getGroupId()).collect(Collectors.toList()));
|
||||
groupIds.addAll(projectPageData.getContent()
|
||||
.stream().map(o -> o.getGroupId()).collect(Collectors.toList()));
|
||||
Map<Integer, GroupPojo> groupMapById = groupDao.selectInIds(groupIds)
|
||||
Map<Integer, Group> groupMapById = groupDao.selectInIds(groupIds)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(o -> o.getId(), o -> o));
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.databasir.core.domain.search.converter;
|
||||
|
||||
import com.databasir.core.domain.search.data.SearchResponse;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullTextPojo;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullText;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.Project;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -12,16 +12,16 @@ import java.util.Map;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface SearchResponseConverter {
|
||||
|
||||
default SearchResponse.Item toItem(DocumentFullTextPojo pojo,
|
||||
Map<Integer, ProjectPojo> projectMapById,
|
||||
Map<Integer, GroupPojo> groupMapById) {
|
||||
ProjectPojo project = projectMapById.get(pojo.getProjectId());
|
||||
GroupPojo group = groupMapById.get(pojo.getGroupId());
|
||||
default SearchResponse.Item toItem(DocumentFullText pojo,
|
||||
Map<Integer, Project> projectMapById,
|
||||
Map<Integer, Group> groupMapById) {
|
||||
Project project = projectMapById.get(pojo.getProjectId());
|
||||
Group group = groupMapById.get(pojo.getGroupId());
|
||||
return toItem(pojo, group.getName(), group.getDescription(), project.getName(), project.getDescription());
|
||||
}
|
||||
|
||||
default SearchResponse.Item toItem(DocumentFullTextPojo pojo,
|
||||
Map<Integer, GroupPojo> groupMapById) {
|
||||
default SearchResponse.Item toItem(DocumentFullText pojo,
|
||||
Map<Integer, Group> groupMapById) {
|
||||
var group = groupMapById.get(pojo.getGroupId());
|
||||
return toItem(pojo,
|
||||
group.getName(),
|
||||
|
@ -34,11 +34,11 @@ public interface SearchResponseConverter {
|
|||
@Mapping(target = "groupDescription", source = "groupDescription")
|
||||
@Mapping(target = "projectName", source = "projectName")
|
||||
@Mapping(target = "projectDescription", source = "projectDescription")
|
||||
SearchResponse.Item toItem(DocumentFullTextPojo item,
|
||||
SearchResponse.Item toItem(DocumentFullText item,
|
||||
String groupName,
|
||||
String groupDescription,
|
||||
String projectName,
|
||||
String projectDescription);
|
||||
|
||||
SearchResponse.Item toItem(DocumentFullTextPojo pojo);
|
||||
SearchResponse.Item toItem(DocumentFullText pojo);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.databasir.core.domain.DomainErrors;
|
|||
import com.databasir.core.domain.system.data.SystemEmailResponse;
|
||||
import com.databasir.core.domain.system.data.SystemEmailUpdateRequest;
|
||||
import com.databasir.dao.impl.SysMailDao;
|
||||
import com.databasir.dao.tables.pojos.SysMailPojo;
|
||||
import com.databasir.dao.tables.pojos.SysMail;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
@ -41,26 +41,26 @@ public class SystemService {
|
|||
}
|
||||
|
||||
public void updateEmailSetting(SystemEmailUpdateRequest request) {
|
||||
SysMailPojo sysMailPojo = new SysMailPojo();
|
||||
sysMailPojo.setSmtpHost(request.getSmtpHost());
|
||||
sysMailPojo.setSmtpPort(request.getSmtpPort());
|
||||
sysMailPojo.setUsername(request.getUsername());
|
||||
sysMailPojo.setUseSsl(request.getUseSSL());
|
||||
SysMail sysMail = new SysMail();
|
||||
sysMail.setSmtpHost(request.getSmtpHost());
|
||||
sysMail.setSmtpPort(request.getSmtpPort());
|
||||
sysMail.setUsername(request.getUsername());
|
||||
sysMail.setUseSsl(request.getUseSSL());
|
||||
|
||||
Optional<Integer> idOpt = sysMailDao.selectOptionTopOne().map(SysMailPojo::getId);
|
||||
idOpt.ifPresent(sysMailPojo::setId);
|
||||
Optional<Integer> idOpt = sysMailDao.selectOptionTopOne().map(SysMail::getId);
|
||||
idOpt.ifPresent(sysMail::setId);
|
||||
if (request.getPassword() != null) {
|
||||
// TODO encrypt password ?
|
||||
sysMailPojo.setPassword(request.getPassword());
|
||||
sysMail.setPassword(request.getPassword());
|
||||
}
|
||||
|
||||
if (idOpt.isPresent()) {
|
||||
if (!StringUtils.hasText(request.getPassword())) {
|
||||
throw DomainErrors.CONNECT_DATABASE_FAILED.exception();
|
||||
}
|
||||
sysMailDao.updateById(sysMailPojo);
|
||||
sysMailDao.updateById(sysMail);
|
||||
} else {
|
||||
sysMailDao.insertAndReturnId(sysMailPojo);
|
||||
sysMailDao.insertAndReturnId(sysMail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@ public interface FavoriteProjectPageResponseConverter {
|
|||
@Mapping(target = "groupId", source = "group.id")
|
||||
@Mapping(target = "groupName", source = "group.name")
|
||||
@Mapping(target = "createAt", source = "favoriteProject.createAt")
|
||||
FavoriteProjectPageResponse to(UserFavoriteProjectPojo favoriteProject,
|
||||
ProjectPojo project,
|
||||
DataSourcePojo dataSource,
|
||||
ProjectSyncRulePojo projectSyncRule,
|
||||
GroupPojo group);
|
||||
FavoriteProjectPageResponse to(UserFavoriteProject favoriteProject,
|
||||
Project project,
|
||||
DataSource dataSource,
|
||||
ProjectSyncRule projectSyncRule,
|
||||
Group group);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.databasir.core.domain.user.converter;
|
||||
|
||||
import com.databasir.core.domain.user.data.UserCreateRequest;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface UserPojoConverter {
|
||||
public interface UserConverter {
|
||||
|
||||
@Mapping(target = "password", source = "hashedPassword")
|
||||
UserPojo of(UserCreateRequest request, String hashedPassword);
|
||||
User of(UserCreateRequest request, String hashedPassword);
|
||||
}
|
|
@ -2,8 +2,8 @@ package com.databasir.core.domain.user.converter;
|
|||
|
||||
import com.databasir.core.domain.user.data.UserDetailResponse;
|
||||
import com.databasir.core.domain.user.data.UserPageResponse;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -13,8 +13,8 @@ import java.util.stream.Collectors;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface UserResponseConverter {
|
||||
|
||||
default UserDetailResponse detailResponse(UserPojo user,
|
||||
List<UserRolePojo> userRoles,
|
||||
default UserDetailResponse detailResponse(User user,
|
||||
List<UserRole> userRoles,
|
||||
Map<Integer, String> groupNameMapById) {
|
||||
List<UserDetailResponse.UserRoleDetailResponse> roles = userRoles.stream()
|
||||
.map(pojo -> userRoleDetailResponse(pojo, groupNameMapById.get(pojo.getGroupId())))
|
||||
|
@ -22,10 +22,10 @@ public interface UserResponseConverter {
|
|||
return detailResponse(user, roles);
|
||||
}
|
||||
|
||||
UserDetailResponse detailResponse(UserPojo pojo, List<UserDetailResponse.UserRoleDetailResponse> roles);
|
||||
UserDetailResponse detailResponse(User pojo, List<UserDetailResponse.UserRoleDetailResponse> roles);
|
||||
|
||||
UserDetailResponse.UserRoleDetailResponse userRoleDetailResponse(UserRolePojo pojo, String groupName);
|
||||
UserDetailResponse.UserRoleDetailResponse userRoleDetailResponse(UserRole pojo, String groupName);
|
||||
|
||||
UserPageResponse pageResponse(UserPojo pojo, Boolean isSysOwner, List<Integer> inGroupIds);
|
||||
UserPageResponse pageResponse(User pojo, Boolean isSysOwner, List<Integer> inGroupIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.databasir.core.domain.user.event.converter;
|
|||
|
||||
import com.databasir.core.domain.user.event.UserCreated;
|
||||
import com.databasir.core.domain.user.event.UserPasswordRenewed;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
|
||||
|
@ -11,11 +11,11 @@ import java.time.LocalDateTime;
|
|||
@Mapper(componentModel = "spring")
|
||||
public interface UserEventConverter {
|
||||
|
||||
UserPasswordRenewed userPasswordRenewed(UserPojo pojo,
|
||||
UserPasswordRenewed userPasswordRenewed(User pojo,
|
||||
Integer renewByUserId,
|
||||
LocalDateTime renewTime,
|
||||
String newPassword);
|
||||
|
||||
@Mapping(target = "userId", source = "userId")
|
||||
UserCreated userCreated(UserPojo pojo, String source, String rawPassword, Integer userId);
|
||||
UserCreated userCreated(User pojo, String source, String rawPassword, Integer userId);
|
||||
}
|
||||
|
|
|
@ -36,29 +36,29 @@ public class UserProjectService {
|
|||
FavoriteProjectPageCondition condition) {
|
||||
var data = userFavoriteProjectDao.selectByCondition(pageable, condition.toCondition(userId));
|
||||
// project data
|
||||
var projectIdList = data.map(UserFavoriteProjectPojo::getProjectId).toList();
|
||||
var projectPojos = projectDao.selectInIds(projectIdList);
|
||||
var projectMapById = projectPojos.stream()
|
||||
.collect(Collectors.toMap(ProjectPojo::getId, Function.identity()));
|
||||
var projectIdList = data.map(UserFavoriteProject::getProjectId).toList();
|
||||
var projects = projectDao.selectInIds(projectIdList);
|
||||
var projectMapById = projects.stream()
|
||||
.collect(Collectors.toMap(Project::getId, Function.identity()));
|
||||
// dataSource data
|
||||
var dataSourceMapByProjectId = dataSourceDao.selectInProjectIds(projectIdList)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(DataSourcePojo::getProjectId, Function.identity()));
|
||||
.collect(Collectors.toMap(DataSource::getProjectId, Function.identity()));
|
||||
// project sync rule data
|
||||
var projectSyncRuleMapByProjectId = projectSyncRuleDao.selectInProjectIds(projectIdList)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(ProjectSyncRulePojo::getProjectId, Function.identity()));
|
||||
.collect(Collectors.toMap(ProjectSyncRule::getProjectId, Function.identity()));
|
||||
// group data
|
||||
var groupIdList = projectPojos.stream().map(ProjectPojo::getGroupId).collect(Collectors.toList());
|
||||
var groupIdList = projects.stream().map(Project::getGroupId).collect(Collectors.toList());
|
||||
var groupMapById = groupDao.selectInIds(groupIdList)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(GroupPojo::getId, Function.identity()));
|
||||
.collect(Collectors.toMap(Group::getId, Function.identity()));
|
||||
// response data
|
||||
return data.map(favorite -> {
|
||||
ProjectPojo project = projectMapById.get(favorite.getProjectId());
|
||||
DataSourcePojo dataSource = dataSourceMapByProjectId.get(favorite.getProjectId());
|
||||
ProjectSyncRulePojo projectSyncRule = projectSyncRuleMapByProjectId.get(favorite.getProjectId());
|
||||
GroupPojo group = null;
|
||||
Project project = projectMapById.get(favorite.getProjectId());
|
||||
DataSource dataSource = dataSourceMapByProjectId.get(favorite.getProjectId());
|
||||
ProjectSyncRule projectSyncRule = projectSyncRuleMapByProjectId.get(favorite.getProjectId());
|
||||
Group group = null;
|
||||
if (project != null) {
|
||||
group = groupMapById.get(project.getGroupId());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.domain.user.service;
|
||||
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.domain.user.converter.UserPojoConverter;
|
||||
import com.databasir.core.domain.user.converter.UserConverter;
|
||||
import com.databasir.core.domain.user.converter.UserResponseConverter;
|
||||
import com.databasir.core.domain.user.data.*;
|
||||
import com.databasir.core.domain.user.event.UserCreated;
|
||||
|
@ -12,9 +12,9 @@ import com.databasir.dao.impl.GroupDao;
|
|||
import com.databasir.dao.impl.LoginDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.GroupPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.Group;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
@ -41,7 +41,7 @@ public class UserService {
|
|||
|
||||
private final LoginDao loginDao;
|
||||
|
||||
private final UserPojoConverter userPojoConverter;
|
||||
private final UserConverter userConverter;
|
||||
|
||||
private final UserResponseConverter userResponseConverter;
|
||||
|
||||
|
@ -53,19 +53,19 @@ public class UserService {
|
|||
private BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
|
||||
|
||||
public Page<UserPageResponse> list(Pageable pageable, UserPageCondition condition) {
|
||||
Page<UserPojo> users = userDao.selectByPage(pageable, condition.toCondition());
|
||||
Page<User> users = userDao.selectByPage(pageable, condition.toCondition());
|
||||
List<Integer> userIds = users.getContent()
|
||||
.stream()
|
||||
.map(UserPojo::getId)
|
||||
.map(User::getId)
|
||||
.collect(toList());
|
||||
List<UserRolePojo> userRoles = userRoleDao.selectByUserIds(userIds);
|
||||
List<UserRole> userRoles = userRoleDao.selectByUserIds(userIds);
|
||||
Map<Integer, List<Integer>> groupIdMapByUserId = userRoles
|
||||
.stream()
|
||||
.filter(ur -> ur.getGroupId() != null)
|
||||
.collect(groupingBy(UserRolePojo::getUserId, mapping(UserRolePojo::getGroupId, toList())));
|
||||
Map<Integer, List<UserRolePojo>> sysOwnerGroupByUserId = userRoles.stream()
|
||||
.collect(groupingBy(UserRole::getUserId, mapping(UserRole::getGroupId, toList())));
|
||||
Map<Integer, List<UserRole>> sysOwnerGroupByUserId = userRoles.stream()
|
||||
.filter(ur -> ur.getRole().equals(SYS_OWNER))
|
||||
.collect(groupingBy(UserRolePojo::getUserId));
|
||||
.collect(groupingBy(UserRole::getUserId));
|
||||
return users.map(user ->
|
||||
userResponseConverter.pageResponse(user, sysOwnerGroupByUserId.containsKey(user.getId()),
|
||||
groupIdMapByUserId.get(user.getId())));
|
||||
|
@ -77,7 +77,7 @@ public class UserService {
|
|||
throw DomainErrors.USERNAME_OR_EMAIL_DUPLICATE.exception();
|
||||
});
|
||||
String hashedPassword = bCryptPasswordEncoder.encode(userCreateRequest.getPassword());
|
||||
UserPojo pojo = userPojoConverter.of(userCreateRequest, hashedPassword);
|
||||
User pojo = userConverter.of(userCreateRequest, hashedPassword);
|
||||
try {
|
||||
Integer id = userDao.insertAndReturnId(pojo);
|
||||
// publish event
|
||||
|
@ -90,36 +90,36 @@ public class UserService {
|
|||
}
|
||||
|
||||
public UserDetailResponse get(Integer userId) {
|
||||
UserPojo pojo = userDao.selectById(userId);
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId));
|
||||
User pojo = userDao.selectById(userId);
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId));
|
||||
List<Integer> groupIds = roles.stream()
|
||||
.map(UserRolePojo::getGroupId)
|
||||
.map(UserRole::getGroupId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(toList());
|
||||
Map<Integer, String> groupNameMapById = groupDao.selectInIds(groupIds)
|
||||
.stream()
|
||||
.collect(toMap(GroupPojo::getId, GroupPojo::getName));
|
||||
.collect(toMap(Group::getId, Group::getName));
|
||||
return userResponseConverter.detailResponse(pojo, roles, groupNameMapById);
|
||||
}
|
||||
|
||||
public Optional<UserDetailResponse> get(String email) {
|
||||
return userDao.selectByEmail(email)
|
||||
.map(user -> {
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(Collections.singletonList(user.getId()));
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(Collections.singletonList(user.getId()));
|
||||
List<Integer> groupIds = roles.stream()
|
||||
.map(UserRolePojo::getGroupId)
|
||||
.map(UserRole::getGroupId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(toList());
|
||||
Map<Integer, String> groupNameMapById = groupDao.selectInIds(groupIds)
|
||||
.stream()
|
||||
.collect(toMap(GroupPojo::getId, GroupPojo::getName));
|
||||
.collect(toMap(Group::getId, Group::getName));
|
||||
return userResponseConverter.detailResponse(user, roles, groupNameMapById);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public String renewPassword(Integer renewByUserId, Integer userId) {
|
||||
UserPojo pojo = userDao.selectById(userId);
|
||||
User pojo = userDao.selectById(userId);
|
||||
String randomPassword = UUID.randomUUID().toString()
|
||||
.replace("-", "")
|
||||
.substring(0, 8);
|
||||
|
@ -151,7 +151,7 @@ public class UserService {
|
|||
|
||||
public void addSysOwnerTo(Integer userId) {
|
||||
if (!userRoleDao.hasRole(userId, SYS_OWNER)) {
|
||||
UserRolePojo role = new UserRolePojo();
|
||||
UserRole role = new UserRole();
|
||||
role.setUserId(userId);
|
||||
role.setRole(SYS_OWNER);
|
||||
userRoleDao.insertAndReturnId(role);
|
||||
|
@ -162,8 +162,8 @@ public class UserService {
|
|||
if (!Objects.equals(request.getNewPassword(), request.getConfirmNewPassword())) {
|
||||
throw DomainErrors.UPDATE_PASSWORD_CONFIRM_FAILED.exception();
|
||||
}
|
||||
UserPojo userPojo = userDao.selectById(userId);
|
||||
if (!bCryptPasswordEncoder.matches(request.getOriginPassword(), userPojo.getPassword())) {
|
||||
User user = userDao.selectById(userId);
|
||||
if (!bCryptPasswordEncoder.matches(request.getOriginPassword(), user.getPassword())) {
|
||||
throw DomainErrors.ORIGIN_PASSWORD_NOT_CORRECT.exception();
|
||||
}
|
||||
String newHashedPassword = bCryptPasswordEncoder.encode(request.getNewPassword());
|
||||
|
@ -172,9 +172,9 @@ public class UserService {
|
|||
}
|
||||
|
||||
public void updateNickname(Integer userId, UserNicknameUpdateRequest request) {
|
||||
UserPojo userPojo = userDao.selectById(userId);
|
||||
userPojo.setNickname(request.getNickname());
|
||||
userDao.updateById(userPojo);
|
||||
User user = userDao.selectById(userId);
|
||||
user.setNickname(request.getNickname());
|
||||
userDao.updateById(user);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.alibaba.excel.util.StringUtils;
|
|||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.core.infrastructure.driver.DriverResources;
|
||||
import com.databasir.dao.impl.DatabaseTypeDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
@ -39,7 +39,7 @@ public class CustomDatabaseConnectionFactory implements DatabaseConnectionFactor
|
|||
@Override
|
||||
public Connection getConnection(Context context) throws SQLException {
|
||||
String databaseType = context.getDatabaseType();
|
||||
DatabaseTypePojo type = databaseTypeDao.selectByDatabaseType(databaseType);
|
||||
DatabaseType type = databaseTypeDao.selectByDatabaseType(databaseType);
|
||||
|
||||
File driverFile = loadDriver(type);
|
||||
URLClassLoader loader = null;
|
||||
|
@ -85,7 +85,7 @@ public class CustomDatabaseConnectionFactory implements DatabaseConnectionFactor
|
|||
return driver.connect(jdbcUrl, info);
|
||||
}
|
||||
|
||||
private File loadDriver(DatabaseTypePojo type) {
|
||||
private File loadDriver(DatabaseType type) {
|
||||
if (StringUtils.isNotBlank(type.getJdbcDriverFilePath())) {
|
||||
return driverResources.loadFromLocal(type.getJdbcDriverFilePath()).getDriverFile();
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ package com.databasir.core.infrastructure.connection;
|
|||
import com.databasir.common.codec.Aes;
|
||||
import com.databasir.core.domain.DomainErrors;
|
||||
import com.databasir.dao.impl.SysKeyDao;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePojo;
|
||||
import com.databasir.dao.tables.pojos.DataSourcePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.SysKeyPojo;
|
||||
import com.databasir.dao.tables.pojos.DataSource;
|
||||
import com.databasir.dao.tables.pojos.DataSourceProperty;
|
||||
import com.databasir.dao.tables.pojos.SysKey;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -22,9 +22,9 @@ public class DatabaseConnectionService {
|
|||
|
||||
private final SysKeyDao sysKeyDao;
|
||||
|
||||
public Connection create(DataSourcePojo dataSource,
|
||||
List<DataSourcePropertyPojo> dataSourceProperties) {
|
||||
SysKeyPojo sysKey = sysKeyDao.selectTopOne();
|
||||
public Connection create(DataSource dataSource,
|
||||
List<DataSourceProperty> dataSourceProperties) {
|
||||
SysKey sysKey = sysKeyDao.selectTopOne();
|
||||
String username = dataSource.getUsername();
|
||||
String password = Aes.decryptFromBase64Data(dataSource.getPassword(), sysKey.getAesKey());
|
||||
String url = dataSource.getUrl();
|
||||
|
|
|
@ -2,19 +2,19 @@ package com.databasir.core.infrastructure.event.subscriber;
|
|||
|
||||
import com.databasir.core.diff.data.DiffType;
|
||||
import com.databasir.core.diff.data.RootDiff;
|
||||
import com.databasir.core.domain.document.converter.DocumentFullTextConverter;
|
||||
import com.databasir.core.domain.document.event.DocumentUpdated;
|
||||
import com.databasir.core.infrastructure.mail.MailSender;
|
||||
import com.databasir.core.infrastructure.mail.MailTemplateProcessor;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.SysMailDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.impl.*;
|
||||
import com.databasir.dao.tables.pojos.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jooq.tools.StringUtils;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.support.TransactionTemplate;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
@ -25,11 +25,24 @@ import java.util.stream.Collectors;
|
|||
@Component
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Async("mailThreadPoolTaskExecutor")
|
||||
public class DocumentEventSubscriber {
|
||||
|
||||
private final ProjectDao projectDao;
|
||||
|
||||
private final GroupDao groupDao;
|
||||
|
||||
private final DatabaseDocumentDao databaseDocumentDao;
|
||||
|
||||
private final TableDocumentDao tableDocumentDao;
|
||||
|
||||
private final TableColumnDocumentDao tableColumnDocumentDao;
|
||||
|
||||
private final DocumentDescriptionDao documentDescriptionDao;
|
||||
|
||||
private final DocumentFullTextDao documentFullTextDao;
|
||||
|
||||
private final DocumentFullTextConverter documentFullTextConverter;
|
||||
|
||||
private final MailSender mailSender;
|
||||
|
||||
private final UserDao userDao;
|
||||
|
@ -38,18 +51,21 @@ public class DocumentEventSubscriber {
|
|||
|
||||
private final MailTemplateProcessor mailTemplateProcessor;
|
||||
|
||||
private final TransactionTemplate transactionTemplate;
|
||||
|
||||
@EventListener(classes = DocumentUpdated.class)
|
||||
public void onDocumentUpdated(DocumentUpdated created) {
|
||||
@Async("mailThreadPoolTaskExecutor")
|
||||
public void sendMailOnUpdated(DocumentUpdated event) {
|
||||
sysMailDao.selectOptionTopOne().ifPresent(mail -> {
|
||||
ProjectPojo project = projectDao.selectById(created.getProjectId());
|
||||
Project project = projectDao.selectById(event.getProjectId());
|
||||
List<String> to = userDao.selectEnabledGroupMembers(project.getGroupId())
|
||||
.stream()
|
||||
.map(UserPojo::getEmail)
|
||||
.map(User::getEmail)
|
||||
.filter(userEmail -> userEmail.contains("@"))
|
||||
.collect(Collectors.toList());
|
||||
if (!to.isEmpty()) {
|
||||
String subject = project.getName() + " 文档有新的内容变更";
|
||||
List<Map<String, String>> diffs = created.getDiff()
|
||||
List<Map<String, String>> diffs = event.getDiff()
|
||||
.map(this::diffs)
|
||||
.orElseGet(Collections::emptyList);
|
||||
Map<String, Object> context = new HashMap<>();
|
||||
|
@ -61,6 +77,11 @@ public class DocumentEventSubscriber {
|
|||
});
|
||||
}
|
||||
|
||||
@EventListener(classes = DocumentUpdated.class)
|
||||
public void updateFullTextOnUpdated(DocumentUpdated event) {
|
||||
updateFullTextIndex(event);
|
||||
}
|
||||
|
||||
private List<Map<String, String>> diffs(RootDiff diff) {
|
||||
if (diff.getDiffType() == DiffType.NONE) {
|
||||
return Collections.emptyList();
|
||||
|
@ -81,4 +102,46 @@ public class DocumentEventSubscriber {
|
|||
}
|
||||
}
|
||||
|
||||
private void updateFullTextIndex(DocumentUpdated event) {
|
||||
Integer projectId = event.getProjectId();
|
||||
Project project = projectDao.selectById(projectId);
|
||||
Group group = groupDao.selectById(project.getGroupId());
|
||||
// save full text
|
||||
var descriptionMapByJoinName = documentDescriptionDao.selectByProjectId(projectId)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
d -> {
|
||||
if (d.getColumnName() == null) {
|
||||
return d.getTableName();
|
||||
}
|
||||
return String.join(".",
|
||||
d.getTableName(),
|
||||
StringUtils.defaultIfBlank(d.getColumnName(), ""));
|
||||
},
|
||||
DocumentDescription::getContent,
|
||||
(a, b) -> a));
|
||||
DatabaseDocument database = databaseDocumentDao.selectById(event.getDatabaseDocumentId());
|
||||
List<TableDocument> tables = tableDocumentDao.selectByDatabaseDocumentId(event.getDatabaseDocumentId());
|
||||
|
||||
// begin transaction
|
||||
transactionTemplate.executeWithoutResult(status -> {
|
||||
// delete all project.table full text
|
||||
int deletedRows = documentFullTextDao.deleteTableFullText(event.getProjectId());
|
||||
// recreate
|
||||
for (TableDocument table : tables) {
|
||||
List<TableColumnDocument> columns = tableColumnDocumentDao.selectByTableDocumentId(table.getId());
|
||||
List<DocumentFullText> fullTextPojoList = columns.stream()
|
||||
.map(column -> {
|
||||
String tableName = table.getName();
|
||||
String tableDescription = descriptionMapByJoinName.get(tableName);
|
||||
String columnDescription = descriptionMapByJoinName.get(tableName + "." + column.getName());
|
||||
return documentFullTextConverter.toPojo(group, project, database, table, column,
|
||||
tableDescription, columnDescription);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
documentFullTextDao.batchInsert(fullTextPojoList);
|
||||
}
|
||||
log.info("refresh project({}) tables fultext success, deleted {} items", projectId, deletedRows);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.databasir.core.domain.group.event.GroupDeleted;
|
|||
import com.databasir.core.domain.group.event.GroupUpdated;
|
||||
import com.databasir.dao.Tables;
|
||||
import com.databasir.dao.impl.DocumentFullTextDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullTextPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullText;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.EventListener;
|
||||
|
@ -24,7 +24,7 @@ public class GroupEventSubscriber {
|
|||
public void refreshFullTextWhenUpdated(GroupUpdated event) {
|
||||
if (!documentFullTextDao.exists(Tables.DOCUMENT_FULL_TEXT.GROUP_ID.eq(event.getGroupId())
|
||||
.and(Tables.DOCUMENT_FULL_TEXT.PROJECT_ID.isNull()))) {
|
||||
DocumentFullTextPojo pojo = new DocumentFullTextPojo();
|
||||
DocumentFullText pojo = new DocumentFullText();
|
||||
pojo.setGroupId(event.getGroupId());
|
||||
pojo.setGroupName(event.getGroupName());
|
||||
pojo.setGroupDescription(event.getGroupDescription());
|
||||
|
@ -48,7 +48,7 @@ public class GroupEventSubscriber {
|
|||
public void addFullTextWhenCreated(GroupCreated event) {
|
||||
if (!documentFullTextDao.exists(Tables.DOCUMENT_FULL_TEXT.GROUP_ID.eq(event.getGroupId())
|
||||
.and(Tables.DOCUMENT_FULL_TEXT.PROJECT_ID.isNull()))) {
|
||||
DocumentFullTextPojo pojo = new DocumentFullTextPojo();
|
||||
DocumentFullText pojo = new DocumentFullText();
|
||||
pojo.setGroupId(event.getGroupId());
|
||||
pojo.setGroupName(event.getGroupName());
|
||||
pojo.setGroupDescription(event.getGroupDescription());
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.databasir.core.domain.project.event.ProjectDeleted;
|
|||
import com.databasir.core.domain.project.event.ProjectSaved;
|
||||
import com.databasir.dao.Tables;
|
||||
import com.databasir.dao.impl.DocumentFullTextDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullTextPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentFullText;
|
||||
import com.databasir.dao.value.FullTextProjectInfoUpdatePojo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -26,7 +26,7 @@ public class ProjectEventSubscriber {
|
|||
public void refreshFullTextWhenUpdated(ProjectSaved event) {
|
||||
if (!documentFullTextDao.exists(Tables.DOCUMENT_FULL_TEXT.PROJECT_ID.eq(event.getProjectId())
|
||||
.and(Tables.DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID.isNull()))) {
|
||||
DocumentFullTextPojo pojo = new DocumentFullTextPojo();
|
||||
DocumentFullText pojo = new DocumentFullText();
|
||||
pojo.setGroupId(event.getGroupId());
|
||||
pojo.setProjectId(event.getProjectId());
|
||||
pojo.setProjectName(event.getProjectName());
|
||||
|
|
|
@ -8,10 +8,10 @@ import com.databasir.dao.impl.DocumentTemplatePropertyDao;
|
|||
import com.databasir.dao.impl.SysKeyDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplatePropertyPojo;
|
||||
import com.databasir.dao.tables.pojos.SysKeyPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentTemplateProperty;
|
||||
import com.databasir.dao.tables.pojos.SysKey;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
|
@ -55,10 +55,10 @@ public class SystemStartedEventSubscriber {
|
|||
List<String> ignoreFields = List.of("createAt", "discussionCount", "id",
|
||||
"columns", "indexes", "triggers", "foreignKeys", "diffType", "original", "keySeq");
|
||||
Map<String, String> fieldChineseMap = fieldChineseMap();
|
||||
BiFunction<Field, DocumentTemplatePropertyType, DocumentTemplatePropertyPojo> mapping = (field, type) -> {
|
||||
BiFunction<Field, DocumentTemplatePropertyType, DocumentTemplateProperty> mapping = (field, type) -> {
|
||||
String key = field.getName();
|
||||
String def = field.getName();
|
||||
DocumentTemplatePropertyPojo pojo = new DocumentTemplatePropertyPojo();
|
||||
DocumentTemplateProperty pojo = new DocumentTemplateProperty();
|
||||
pojo.setType(type);
|
||||
pojo.setKey(key);
|
||||
pojo.setDefaultValue(fieldChineseMap.getOrDefault(key, def));
|
||||
|
@ -66,40 +66,40 @@ public class SystemStartedEventSubscriber {
|
|||
};
|
||||
// table field name;
|
||||
Field[] fields = TableDocumentResponse.class.getDeclaredFields();
|
||||
List<DocumentTemplatePropertyPojo> tableProperties = Arrays.stream(fields)
|
||||
List<DocumentTemplateProperty> tableProperties = Arrays.stream(fields)
|
||||
.filter(field -> !ignoreFields.contains(field.getName()))
|
||||
.map(field -> mapping.apply(field, DocumentTemplatePropertyType.TABLE_FIELD_NAME))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// column field name;
|
||||
Field[] columnFields = TableDocumentResponse.ColumnDocumentResponse.class.getDeclaredFields();
|
||||
List<DocumentTemplatePropertyPojo> columnProperties = Arrays.stream(columnFields)
|
||||
List<DocumentTemplateProperty> columnProperties = Arrays.stream(columnFields)
|
||||
.filter(f -> !ignoreFields.contains(f.getName()))
|
||||
.map(field -> mapping.apply(field, DocumentTemplatePropertyType.COLUMN_FIELD_NAME))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// index field name;
|
||||
Field[] indexFields = TableDocumentResponse.IndexDocumentResponse.class.getDeclaredFields();
|
||||
List<DocumentTemplatePropertyPojo> indexProperties = Arrays.stream(indexFields)
|
||||
List<DocumentTemplateProperty> indexProperties = Arrays.stream(indexFields)
|
||||
.filter(f -> !ignoreFields.contains(f.getName()))
|
||||
.map(field -> mapping.apply(field, DocumentTemplatePropertyType.INDEX_FIELD_NAME))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// foreign key field name;
|
||||
Field[] fkFields = TableDocumentResponse.ForeignKeyDocumentResponse.class.getDeclaredFields();
|
||||
List<DocumentTemplatePropertyPojo> fkProperties = Arrays.stream(fkFields)
|
||||
List<DocumentTemplateProperty> fkProperties = Arrays.stream(fkFields)
|
||||
.filter(f -> !ignoreFields.contains(f.getName()))
|
||||
.map(field -> mapping.apply(field, DocumentTemplatePropertyType.FOREIGN_KEY_FIELD_NAME))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// trigger field name;
|
||||
Field[] triggerFields = TableDocumentResponse.TriggerDocumentResponse.class.getDeclaredFields();
|
||||
List<DocumentTemplatePropertyPojo> triggerProperties = Arrays.stream(triggerFields)
|
||||
List<DocumentTemplateProperty> triggerProperties = Arrays.stream(triggerFields)
|
||||
.filter(f -> !ignoreFields.contains(f.getName()))
|
||||
.map(field -> mapping.apply(field, DocumentTemplatePropertyType.TRIGGER_FIELD_NAME))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<DocumentTemplatePropertyPojo> properties = new ArrayList<>();
|
||||
List<DocumentTemplateProperty> properties = new ArrayList<>();
|
||||
properties.addAll(tableProperties);
|
||||
properties.addAll(columnProperties);
|
||||
properties.addAll(indexProperties);
|
||||
|
@ -145,7 +145,7 @@ public class SystemStartedEventSubscriber {
|
|||
private void initSysOwnerIfNecessary() {
|
||||
sysKeyDao.selectOptionTopOne()
|
||||
.orElseGet(() -> {
|
||||
SysKeyPojo pojo = new SysKeyPojo();
|
||||
SysKey pojo = new SysKey();
|
||||
pojo.setAesKey(Aes.randomBase64Key());
|
||||
Rsa.RsaBase64Key key = Rsa.generateBase64Key();
|
||||
pojo.setRsaPublicKey(key.getPublicBase64Key());
|
||||
|
@ -156,16 +156,16 @@ public class SystemStartedEventSubscriber {
|
|||
|
||||
String email = "N/A";
|
||||
String username = "databasir";
|
||||
Optional<UserPojo> userOpt = userDao.selectByEmailOrUsername(username);
|
||||
Optional<User> userOpt = userDao.selectByEmailOrUsername(username);
|
||||
if (!userOpt.isPresent()) {
|
||||
UserPojo admin = new UserPojo();
|
||||
User admin = new User();
|
||||
admin.setEmail(email);
|
||||
admin.setUsername(username);
|
||||
admin.setPassword(bCryptPasswordEncoder.encode(username));
|
||||
admin.setEnabled(true);
|
||||
admin.setNickname("Databasir Admin");
|
||||
Integer userId = userDao.insertAndReturnId(admin);
|
||||
UserRolePojo role = new UserRolePojo();
|
||||
UserRole role = new UserRole();
|
||||
role.setUserId(userId);
|
||||
role.setRole(SYS_OWNER);
|
||||
userRoleDao.insertAndReturnId(role);
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.databasir.core.infrastructure.mail.MailSender;
|
|||
import com.databasir.core.infrastructure.mail.MailTemplateProcessor;
|
||||
import com.databasir.dao.impl.SysMailDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.EventListener;
|
||||
|
@ -33,7 +33,7 @@ public class UserEventSubscriber {
|
|||
|
||||
@EventListener(classes = UserPasswordRenewed.class)
|
||||
public void onPasswordRenewed(UserPasswordRenewed event) {
|
||||
UserPojo operator = userDao.selectById(event.getRenewByUserId());
|
||||
User operator = userDao.selectById(event.getRenewByUserId());
|
||||
sysMailDao.selectOptionTopOne()
|
||||
.ifPresent(mailPojo -> {
|
||||
String renewBy = operator.getNickname();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.databasir.core.infrastructure.mail;
|
||||
|
||||
import com.databasir.common.SystemException;
|
||||
import com.databasir.dao.tables.pojos.SysMailPojo;
|
||||
import com.databasir.dao.tables.pojos.SysMail;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
|
@ -16,14 +16,14 @@ import java.util.Collections;
|
|||
@Component
|
||||
public class MailSender {
|
||||
|
||||
public void sendHtml(SysMailPojo mail,
|
||||
public void sendHtml(SysMail mail,
|
||||
String to,
|
||||
String subject,
|
||||
String content) {
|
||||
this.batchSendHtml(mail, Collections.singleton(to), subject, content);
|
||||
}
|
||||
|
||||
public void batchSendHtml(SysMailPojo mail,
|
||||
public void batchSendHtml(SysMail mail,
|
||||
Collection<String> to,
|
||||
String subject,
|
||||
String content) {
|
||||
|
@ -41,7 +41,7 @@ public class MailSender {
|
|||
}
|
||||
}
|
||||
|
||||
private JavaMailSender initJavaMailSender(SysMailPojo properties) {
|
||||
private JavaMailSender initJavaMailSender(SysMail properties) {
|
||||
JavaMailSenderImpl sender = new JavaMailSenderImpl();
|
||||
sender.setHost(properties.getSmtpHost());
|
||||
if (properties.getSmtpPort() != null) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.databasir.core.domain.database.data.DatabaseTypeUpdateRequest;
|
|||
import com.databasir.core.infrastructure.driver.DriverResources;
|
||||
import com.databasir.core.infrastructure.driver.DriverResult;
|
||||
import com.databasir.dao.impl.DatabaseTypeDao;
|
||||
import com.databasir.dao.tables.pojos.DatabaseTypePojo;
|
||||
import com.databasir.dao.tables.pojos.DatabaseType;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -87,7 +87,7 @@ class DatabaseTypeServiceTest extends BaseTest {
|
|||
request.setUrlPattern("{{jdbc.protocol}}//{{db.url}}/{{db.schema}}");
|
||||
databaseTypeService.update(request);
|
||||
|
||||
DatabaseTypePojo pojo = databaseTypeDao.selectByDatabaseType("new-type");
|
||||
DatabaseType pojo = databaseTypeDao.selectByDatabaseType("new-type");
|
||||
Assertions.assertNotNull(pojo);
|
||||
Assertions.assertEquals("integration test", pojo.getDescription());
|
||||
Assertions.assertEquals("jdbc:postgresql", pojo.getJdbcProtocol());
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.databasir.core.domain.description.service;
|
|||
import com.databasir.core.BaseTest;
|
||||
import com.databasir.core.domain.description.data.DocumentDescriptionSaveRequest;
|
||||
import com.databasir.dao.impl.DocumentDescriptionDao;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescriptionPojo;
|
||||
import com.databasir.dao.tables.pojos.DocumentDescription;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -42,7 +42,7 @@ class DocumentDescriptionServiceTest extends BaseTest {
|
|||
documentDescriptionService.save(groupId, projectId, userId, updateRequest);
|
||||
var tableData = documentDescriptionDao.selectTableDescriptionByProjectId(projectId);
|
||||
Assertions.assertEquals(0, tableData.size());
|
||||
List<DocumentDescriptionPojo> descriptionData = documentDescriptionDao.selectByProjectId(projectId);
|
||||
List<DocumentDescription> descriptionData = documentDescriptionDao.selectByProjectId(projectId);
|
||||
Assertions.assertEquals(1, descriptionData.size());
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@ import com.databasir.dao.impl.GroupDao;
|
|||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.ProjectSyncRuleDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRulePojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRule;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
|
@ -53,7 +53,7 @@ class GroupServiceTest extends BaseTest {
|
|||
Integer groupId = groupService.create(request);
|
||||
assertNotNull(groupId);
|
||||
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(List.of(1, 2, 3))
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(List.of(1, 2, 3))
|
||||
.stream()
|
||||
.filter(r -> Objects.equals(r.getGroupId(), groupId) && r.getRole().equals("GROUP_OWNER"))
|
||||
.collect(Collectors.toList());
|
||||
|
@ -71,11 +71,11 @@ class GroupServiceTest extends BaseTest {
|
|||
request.setGroupOwnerUserIds(List.of(1000, 1001));
|
||||
groupService.update(request);
|
||||
|
||||
List<UserRolePojo> members = userRoleDao.selectList(Tables.USER_ROLE.GROUP_ID.eq(groupId));
|
||||
List<UserRole> members = userRoleDao.selectList(Tables.USER_ROLE.GROUP_ID.eq(groupId));
|
||||
assertEquals(3, members.size());
|
||||
List<Integer> ownerUserIds = members.stream()
|
||||
.filter(r -> r.getRole().equals("GROUP_OWNER"))
|
||||
.map(UserRolePojo::getUserId)
|
||||
.map(UserRole::getUserId)
|
||||
.collect(Collectors.toList());
|
||||
assertEquals(2, ownerUserIds.size());
|
||||
assertTrue(ownerUserIds.contains(1000));
|
||||
|
@ -95,11 +95,11 @@ class GroupServiceTest extends BaseTest {
|
|||
assertEquals(0, projectIds.size());
|
||||
|
||||
// should clear group members
|
||||
List<UserRolePojo> members = userRoleDao.selectList(Tables.USER_ROLE.GROUP_ID.eq(groupId));
|
||||
List<UserRole> members = userRoleDao.selectList(Tables.USER_ROLE.GROUP_ID.eq(groupId));
|
||||
assertEquals(0, members.size());
|
||||
|
||||
// should clear project sync schedule
|
||||
List<ProjectSyncRulePojo> syncRule = projectSyncRuleDao.selectInProjectIds(undeleteProjectIds);
|
||||
List<ProjectSyncRule> syncRule = projectSyncRuleDao.selectInProjectIds(undeleteProjectIds);
|
||||
assertTrue(syncRule.stream().allMatch(r -> !r.getIsAutoSync()));
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ class GroupServiceTest extends BaseTest {
|
|||
|
||||
groupService.changeMemberRole(groupId, userId, RoleConstants.GROUP_OWNER);
|
||||
assertTrue(userRoleDao.hasRole(userId, groupId, RoleConstants.GROUP_OWNER));
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(List.of(userId));
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(List.of(userId));
|
||||
assertEquals(1, roles.size());
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ import com.databasir.core.domain.login.data.AccessTokenRefreshRequest;
|
|||
import com.databasir.core.domain.login.data.AccessTokenRefreshResponse;
|
||||
import com.databasir.core.domain.login.data.LoginKeyResponse;
|
||||
import com.databasir.dao.impl.LoginDao;
|
||||
import com.databasir.dao.tables.pojos.LoginPojo;
|
||||
import com.databasir.dao.tables.pojos.Login;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -74,7 +74,7 @@ class LoginServiceTest extends BaseTest {
|
|||
int userId = -1000;
|
||||
LoginKeyResponse token = loginService.generate(userId);
|
||||
Assertions.assertNotNull(token);
|
||||
Optional<LoginPojo> loginOpt = loginDao.selectByUserId(userId);
|
||||
Optional<Login> loginOpt = loginDao.selectByUserId(userId);
|
||||
Assertions.assertTrue(loginOpt.isPresent());
|
||||
Assertions.assertEquals(token.getAccessToken(), loginOpt.get().getAccessToken());
|
||||
Assertions.assertEquals(token.getRefreshToken(), loginOpt.get().getRefreshToken());
|
||||
|
|
|
@ -11,7 +11,7 @@ import com.databasir.core.domain.project.data.ProjectUpdateRequest.ProjectSyncRu
|
|||
import com.databasir.core.infrastructure.connection.DatabaseTypes;
|
||||
import com.databasir.dao.impl.ProjectDao;
|
||||
import com.databasir.dao.impl.ProjectSyncRuleDao;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRulePojo;
|
||||
import com.databasir.dao.tables.pojos.ProjectSyncRule;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -105,7 +105,7 @@ class ProjectServiceTest extends BaseTest {
|
|||
int projectId = -1000;
|
||||
projectService.delete(projectId);
|
||||
Assertions.assertFalse(projectDao.existsById(projectId));
|
||||
ProjectSyncRulePojo syncRule = projectSyncRuleDao.selectByProjectId(projectId);
|
||||
ProjectSyncRule syncRule = projectSyncRuleDao.selectByProjectId(projectId);
|
||||
Assertions.assertNotNull(syncRule);
|
||||
Assertions.assertNotNull(syncRule.getAutoSyncCron());
|
||||
Assertions.assertFalse(syncRule.getIsAutoSync());
|
||||
|
|
|
@ -9,9 +9,9 @@ import com.databasir.core.infrastructure.event.subscriber.UserEventSubscriber;
|
|||
import com.databasir.dao.impl.LoginDao;
|
||||
import com.databasir.dao.impl.UserDao;
|
||||
import com.databasir.dao.impl.UserRoleDao;
|
||||
import com.databasir.dao.tables.pojos.LoginPojo;
|
||||
import com.databasir.dao.tables.pojos.UserPojo;
|
||||
import com.databasir.dao.tables.pojos.UserRolePojo;
|
||||
import com.databasir.dao.tables.pojos.Login;
|
||||
import com.databasir.dao.tables.pojos.User;
|
||||
import com.databasir.dao.tables.pojos.UserRole;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
@ -78,12 +78,12 @@ class UserServiceTest extends BaseTest {
|
|||
void switchEnableStatusToFalse() {
|
||||
Integer userId = -999;
|
||||
userService.switchEnableStatus(userId, false);
|
||||
UserPojo user = userDao.selectById(userId);
|
||||
User user = userDao.selectById(userId);
|
||||
assertNotNull(user);
|
||||
assertFalse(user.getEnabled());
|
||||
|
||||
Optional<LoginPojo> loginPojoOpt = loginDao.selectByUserId(userId);
|
||||
assertTrue(loginPojoOpt.isEmpty());
|
||||
Optional<Login> login = loginDao.selectByUserId(userId);
|
||||
assertTrue(login.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -91,7 +91,7 @@ class UserServiceTest extends BaseTest {
|
|||
void removeSysOwnerFrom() {
|
||||
Integer userId = -998;
|
||||
userService.removeSysOwnerFrom(userId);
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId))
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId))
|
||||
.stream().filter(role -> role.getRole().equals(SYS_OWNER))
|
||||
.collect(Collectors.toList());
|
||||
assertEquals(0, roles.size());
|
||||
|
@ -102,7 +102,7 @@ class UserServiceTest extends BaseTest {
|
|||
void addSysOwnerTo() {
|
||||
Integer userId = -999;
|
||||
userService.addSysOwnerTo(userId);
|
||||
List<UserRolePojo> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId))
|
||||
List<UserRole> roles = userRoleDao.selectByUserIds(Collections.singletonList(userId))
|
||||
.stream().filter(role -> role.getRole().equals(SYS_OWNER))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
@ -120,8 +120,8 @@ class UserServiceTest extends BaseTest {
|
|||
Integer userId = -999;
|
||||
userService.updatePassword(userId, request);
|
||||
// should delete login info
|
||||
Optional<LoginPojo> loginPojoOpt = loginDao.selectByUserId(userId);
|
||||
assertTrue(loginPojoOpt.isEmpty());
|
||||
Optional<Login> login = loginDao.selectByUserId(userId);
|
||||
assertTrue(login.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -133,7 +133,7 @@ class UserServiceTest extends BaseTest {
|
|||
request.setNickname(nickname);
|
||||
userService.updateNickname(userId, request);
|
||||
|
||||
UserPojo user = userDao.selectById(userId);
|
||||
User user = userDao.selectById(userId);
|
||||
assertNotNull(user);
|
||||
assertEquals(nickname, user.getNickname());
|
||||
}
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
package com.databasir.dao;
|
||||
|
||||
|
||||
import com.databasir.dao.tables.DataSource;
|
||||
import com.databasir.dao.tables.DataSourceProperty;
|
||||
import com.databasir.dao.tables.DatabaseDocument;
|
||||
import com.databasir.dao.tables.DatabaseType;
|
||||
import com.databasir.dao.tables.DocumentDescription;
|
||||
import com.databasir.dao.tables.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.DocumentFullText;
|
||||
import com.databasir.dao.tables.DocumentTemplateProperty;
|
||||
import com.databasir.dao.tables.Group;
|
||||
import com.databasir.dao.tables.Login;
|
||||
import com.databasir.dao.tables.MockDataRule;
|
||||
import com.databasir.dao.tables.OauthApp;
|
||||
import com.databasir.dao.tables.OperationLog;
|
||||
import com.databasir.dao.tables.Project;
|
||||
import com.databasir.dao.tables.ProjectSyncRule;
|
||||
import com.databasir.dao.tables.ProjectSyncTask;
|
||||
import com.databasir.dao.tables.SysKey;
|
||||
import com.databasir.dao.tables.SysMail;
|
||||
import com.databasir.dao.tables.TableColumnDocument;
|
||||
import com.databasir.dao.tables.TableDocument;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocument;
|
||||
import com.databasir.dao.tables.TableIndexDocument;
|
||||
import com.databasir.dao.tables.TableTriggerDocument;
|
||||
import com.databasir.dao.tables.User;
|
||||
import com.databasir.dao.tables.UserFavoriteProject;
|
||||
import com.databasir.dao.tables.UserRole;
|
||||
import com.databasir.dao.tables.DataSourcePropertyTable;
|
||||
import com.databasir.dao.tables.DataSourceTable;
|
||||
import com.databasir.dao.tables.DatabaseDocumentTable;
|
||||
import com.databasir.dao.tables.DatabaseTypeTable;
|
||||
import com.databasir.dao.tables.DocumentDescriptionTable;
|
||||
import com.databasir.dao.tables.DocumentDiscussionTable;
|
||||
import com.databasir.dao.tables.DocumentFullTextTable;
|
||||
import com.databasir.dao.tables.DocumentTemplatePropertyTable;
|
||||
import com.databasir.dao.tables.GroupTable;
|
||||
import com.databasir.dao.tables.LoginTable;
|
||||
import com.databasir.dao.tables.MockDataRuleTable;
|
||||
import com.databasir.dao.tables.OauthAppTable;
|
||||
import com.databasir.dao.tables.OperationLogTable;
|
||||
import com.databasir.dao.tables.ProjectSyncRuleTable;
|
||||
import com.databasir.dao.tables.ProjectSyncTaskTable;
|
||||
import com.databasir.dao.tables.ProjectTable;
|
||||
import com.databasir.dao.tables.SysKeyTable;
|
||||
import com.databasir.dao.tables.SysMailTable;
|
||||
import com.databasir.dao.tables.TableColumnDocumentTable;
|
||||
import com.databasir.dao.tables.TableDocumentTable;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocumentTable;
|
||||
import com.databasir.dao.tables.TableIndexDocumentTable;
|
||||
import com.databasir.dao.tables.TableTriggerDocumentTable;
|
||||
import com.databasir.dao.tables.UserFavoriteProjectTable;
|
||||
import com.databasir.dao.tables.UserRoleTable;
|
||||
import com.databasir.dao.tables.UserTable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -55,132 +55,132 @@ public class Databasir extends SchemaImpl {
|
|||
/**
|
||||
* The table <code>databasir.data_source</code>.
|
||||
*/
|
||||
public final DataSource DATA_SOURCE = DataSource.DATA_SOURCE;
|
||||
public final DataSourceTable DATA_SOURCE = DataSourceTable.DATA_SOURCE;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.data_source_property</code>.
|
||||
*/
|
||||
public final DataSourceProperty DATA_SOURCE_PROPERTY = DataSourceProperty.DATA_SOURCE_PROPERTY;
|
||||
public final DataSourcePropertyTable DATA_SOURCE_PROPERTY = DataSourcePropertyTable.DATA_SOURCE_PROPERTY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.database_document</code>.
|
||||
*/
|
||||
public final DatabaseDocument DATABASE_DOCUMENT = DatabaseDocument.DATABASE_DOCUMENT;
|
||||
public final DatabaseDocumentTable DATABASE_DOCUMENT = DatabaseDocumentTable.DATABASE_DOCUMENT;
|
||||
|
||||
/**
|
||||
* customer database types
|
||||
*/
|
||||
public final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
||||
public final DatabaseTypeTable DATABASE_TYPE = DatabaseTypeTable.DATABASE_TYPE;
|
||||
|
||||
/**
|
||||
* custom document description
|
||||
*/
|
||||
public final DocumentDescription DOCUMENT_DESCRIPTION = DocumentDescription.DOCUMENT_DESCRIPTION;
|
||||
public final DocumentDescriptionTable DOCUMENT_DESCRIPTION = DocumentDescriptionTable.DOCUMENT_DESCRIPTION;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.document_discussion</code>.
|
||||
*/
|
||||
public final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
|
||||
public final DocumentDiscussionTable DOCUMENT_DISCUSSION = DocumentDiscussionTable.DOCUMENT_DISCUSSION;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.document_full_text</code>.
|
||||
*/
|
||||
public final DocumentFullText DOCUMENT_FULL_TEXT = DocumentFullText.DOCUMENT_FULL_TEXT;
|
||||
public final DocumentFullTextTable DOCUMENT_FULL_TEXT = DocumentFullTextTable.DOCUMENT_FULL_TEXT;
|
||||
|
||||
/**
|
||||
* template property
|
||||
*/
|
||||
public final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY;
|
||||
public final DocumentTemplatePropertyTable DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.group</code>.
|
||||
*/
|
||||
public final Group GROUP = Group.GROUP;
|
||||
public final GroupTable GROUP = GroupTable.GROUP;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.login</code>.
|
||||
*/
|
||||
public final Login LOGIN = Login.LOGIN;
|
||||
public final LoginTable LOGIN = LoginTable.LOGIN;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.mock_data_rule</code>.
|
||||
*/
|
||||
public final MockDataRule MOCK_DATA_RULE = MockDataRule.MOCK_DATA_RULE;
|
||||
public final MockDataRuleTable MOCK_DATA_RULE = MockDataRuleTable.MOCK_DATA_RULE;
|
||||
|
||||
/**
|
||||
* oauth app info
|
||||
*/
|
||||
public final OauthApp OAUTH_APP = OauthApp.OAUTH_APP;
|
||||
public final OauthAppTable OAUTH_APP = OauthAppTable.OAUTH_APP;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.operation_log</code>.
|
||||
*/
|
||||
public final OperationLog OPERATION_LOG = OperationLog.OPERATION_LOG;
|
||||
public final OperationLogTable OPERATION_LOG = OperationLogTable.OPERATION_LOG;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project</code>.
|
||||
*/
|
||||
public final Project PROJECT = Project.PROJECT;
|
||||
public final ProjectTable PROJECT = ProjectTable.PROJECT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project_sync_rule</code>.
|
||||
*/
|
||||
public final ProjectSyncRule PROJECT_SYNC_RULE = ProjectSyncRule.PROJECT_SYNC_RULE;
|
||||
public final ProjectSyncRuleTable PROJECT_SYNC_RULE = ProjectSyncRuleTable.PROJECT_SYNC_RULE;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project_sync_task</code>.
|
||||
*/
|
||||
public final ProjectSyncTask PROJECT_SYNC_TASK = ProjectSyncTask.PROJECT_SYNC_TASK;
|
||||
public final ProjectSyncTaskTable PROJECT_SYNC_TASK = ProjectSyncTaskTable.PROJECT_SYNC_TASK;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.sys_key</code>.
|
||||
*/
|
||||
public final SysKey SYS_KEY = SysKey.SYS_KEY;
|
||||
public final SysKeyTable SYS_KEY = SysKeyTable.SYS_KEY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.sys_mail</code>.
|
||||
*/
|
||||
public final SysMail SYS_MAIL = SysMail.SYS_MAIL;
|
||||
public final SysMailTable SYS_MAIL = SysMailTable.SYS_MAIL;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_column_document</code>.
|
||||
*/
|
||||
public final TableColumnDocument TABLE_COLUMN_DOCUMENT = TableColumnDocument.TABLE_COLUMN_DOCUMENT;
|
||||
public final TableColumnDocumentTable TABLE_COLUMN_DOCUMENT = TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_document</code>.
|
||||
*/
|
||||
public final TableDocument TABLE_DOCUMENT = TableDocument.TABLE_DOCUMENT;
|
||||
public final TableDocumentTable TABLE_DOCUMENT = TableDocumentTable.TABLE_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_foreign_key_document</code>.
|
||||
*/
|
||||
public final TableForeignKeyDocument TABLE_FOREIGN_KEY_DOCUMENT = TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT;
|
||||
public final TableForeignKeyDocumentTable TABLE_FOREIGN_KEY_DOCUMENT = TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_index_document</code>.
|
||||
*/
|
||||
public final TableIndexDocument TABLE_INDEX_DOCUMENT = TableIndexDocument.TABLE_INDEX_DOCUMENT;
|
||||
public final TableIndexDocumentTable TABLE_INDEX_DOCUMENT = TableIndexDocumentTable.TABLE_INDEX_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_trigger_document</code>.
|
||||
*/
|
||||
public final TableTriggerDocument TABLE_TRIGGER_DOCUMENT = TableTriggerDocument.TABLE_TRIGGER_DOCUMENT;
|
||||
public final TableTriggerDocumentTable TABLE_TRIGGER_DOCUMENT = TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user</code>.
|
||||
*/
|
||||
public final User USER = User.USER;
|
||||
public final UserTable USER = UserTable.USER;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user_favorite_project</code>.
|
||||
*/
|
||||
public final UserFavoriteProject USER_FAVORITE_PROJECT = UserFavoriteProject.USER_FAVORITE_PROJECT;
|
||||
public final UserFavoriteProjectTable USER_FAVORITE_PROJECT = UserFavoriteProjectTable.USER_FAVORITE_PROJECT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user_role</code>.
|
||||
*/
|
||||
public final UserRole USER_ROLE = UserRole.USER_ROLE;
|
||||
public final UserRoleTable USER_ROLE = UserRoleTable.USER_ROLE;
|
||||
|
||||
/**
|
||||
* No further instances allowed
|
||||
|
@ -198,32 +198,32 @@ public class Databasir extends SchemaImpl {
|
|||
@Override
|
||||
public final List<Table<?>> getTables() {
|
||||
return Arrays.asList(
|
||||
DataSource.DATA_SOURCE,
|
||||
DataSourceProperty.DATA_SOURCE_PROPERTY,
|
||||
DatabaseDocument.DATABASE_DOCUMENT,
|
||||
DatabaseType.DATABASE_TYPE,
|
||||
DocumentDescription.DOCUMENT_DESCRIPTION,
|
||||
DocumentDiscussion.DOCUMENT_DISCUSSION,
|
||||
DocumentFullText.DOCUMENT_FULL_TEXT,
|
||||
DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY,
|
||||
Group.GROUP,
|
||||
Login.LOGIN,
|
||||
MockDataRule.MOCK_DATA_RULE,
|
||||
OauthApp.OAUTH_APP,
|
||||
OperationLog.OPERATION_LOG,
|
||||
Project.PROJECT,
|
||||
ProjectSyncRule.PROJECT_SYNC_RULE,
|
||||
ProjectSyncTask.PROJECT_SYNC_TASK,
|
||||
SysKey.SYS_KEY,
|
||||
SysMail.SYS_MAIL,
|
||||
TableColumnDocument.TABLE_COLUMN_DOCUMENT,
|
||||
TableDocument.TABLE_DOCUMENT,
|
||||
TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT,
|
||||
TableIndexDocument.TABLE_INDEX_DOCUMENT,
|
||||
TableTriggerDocument.TABLE_TRIGGER_DOCUMENT,
|
||||
User.USER,
|
||||
UserFavoriteProject.USER_FAVORITE_PROJECT,
|
||||
UserRole.USER_ROLE
|
||||
DataSourceTable.DATA_SOURCE,
|
||||
DataSourcePropertyTable.DATA_SOURCE_PROPERTY,
|
||||
DatabaseDocumentTable.DATABASE_DOCUMENT,
|
||||
DatabaseTypeTable.DATABASE_TYPE,
|
||||
DocumentDescriptionTable.DOCUMENT_DESCRIPTION,
|
||||
DocumentDiscussionTable.DOCUMENT_DISCUSSION,
|
||||
DocumentFullTextTable.DOCUMENT_FULL_TEXT,
|
||||
DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY,
|
||||
GroupTable.GROUP,
|
||||
LoginTable.LOGIN,
|
||||
MockDataRuleTable.MOCK_DATA_RULE,
|
||||
OauthAppTable.OAUTH_APP,
|
||||
OperationLogTable.OPERATION_LOG,
|
||||
ProjectTable.PROJECT,
|
||||
ProjectSyncRuleTable.PROJECT_SYNC_RULE,
|
||||
ProjectSyncTaskTable.PROJECT_SYNC_TASK,
|
||||
SysKeyTable.SYS_KEY,
|
||||
SysMailTable.SYS_MAIL,
|
||||
TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT,
|
||||
TableDocumentTable.TABLE_DOCUMENT,
|
||||
TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT,
|
||||
TableIndexDocumentTable.TABLE_INDEX_DOCUMENT,
|
||||
TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT,
|
||||
UserTable.USER,
|
||||
UserFavoriteProjectTable.USER_FAVORITE_PROJECT,
|
||||
UserRoleTable.USER_ROLE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
package com.databasir.dao;
|
||||
|
||||
|
||||
import com.databasir.dao.tables.DataSourceProperty;
|
||||
import com.databasir.dao.tables.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.DocumentFullText;
|
||||
import com.databasir.dao.tables.ProjectSyncTask;
|
||||
import com.databasir.dao.tables.TableColumnDocument;
|
||||
import com.databasir.dao.tables.TableDocument;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocument;
|
||||
import com.databasir.dao.tables.TableIndexDocument;
|
||||
import com.databasir.dao.tables.TableTriggerDocument;
|
||||
import com.databasir.dao.tables.DataSourcePropertyTable;
|
||||
import com.databasir.dao.tables.DocumentDiscussionTable;
|
||||
import com.databasir.dao.tables.DocumentFullTextTable;
|
||||
import com.databasir.dao.tables.ProjectSyncTaskTable;
|
||||
import com.databasir.dao.tables.TableColumnDocumentTable;
|
||||
import com.databasir.dao.tables.TableDocumentTable;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocumentTable;
|
||||
import com.databasir.dao.tables.TableIndexDocumentTable;
|
||||
import com.databasir.dao.tables.TableTriggerDocumentTable;
|
||||
|
||||
import org.jooq.Index;
|
||||
import org.jooq.OrderField;
|
||||
|
@ -30,24 +30,24 @@ public class Indexes {
|
|||
// INDEX definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_COLUMN = Internal.createIndex(DSL.name("FIDX_COLUMN"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.COL_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.COL_COMMENT, DocumentFullText.DOCUMENT_FULL_TEXT.COL_DESCRIPTION, DocumentFullText.DOCUMENT_FULL_TEXT.DATABASE_PRODUCT_NAME }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_GROUP = Internal.createIndex(DSL.name("FIDX_GROUP"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.GROUP_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.GROUP_DESCRIPTION }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_PROJECT = Internal.createIndex(DSL.name("FIDX_PROJECT"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.PROJECT_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.PROJECT_DESCRIPTION, DocumentFullText.DOCUMENT_FULL_TEXT.SCHEMA_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.DATABASE_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.DATABASE_TYPE }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_TABLE = Internal.createIndex(DSL.name("FIDX_TABLE"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.TABLE_NAME, DocumentFullText.DOCUMENT_FULL_TEXT.TABLE_COMMENT, DocumentFullText.DOCUMENT_FULL_TEXT.TABLE_DESCRIPTION, DocumentFullText.DOCUMENT_FULL_TEXT.DATABASE_PRODUCT_NAME }, false);
|
||||
public static final Index DATA_SOURCE_PROPERTY_IDX_DATA_SOURCE_ID = Internal.createIndex(DSL.name("idx_data_source_id"), DataSourceProperty.DATA_SOURCE_PROPERTY, new OrderField[] { DataSourceProperty.DATA_SOURCE_PROPERTY.DATA_SOURCE_ID }, false);
|
||||
public static final Index TABLE_COLUMN_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableColumnDocument.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableDocument.TABLE_DOCUMENT, new OrderField[] { TableDocument.TABLE_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_FOREIGN_KEY_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT, new OrderField[] { TableForeignKeyDocument.TABLE_FOREIGN_KEY_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 DOCUMENT_FULL_TEXT_IDX_GROUP_ID = Internal.createIndex(DSL.name("IDX_GROUP_ID"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.GROUP_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 DOCUMENT_FULL_TEXT_IDX_PROJECT_ID = Internal.createIndex(DSL.name("IDX_PROJECT_ID"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.PROJECT_ID }, false);
|
||||
public static final Index PROJECT_SYNC_TASK_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), ProjectSyncTask.PROJECT_SYNC_TASK, new OrderField[] { ProjectSyncTask.PROJECT_SYNC_TASK.PROJECT_ID }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("IDX_TABLE_DOCUMENT_ID"), DocumentFullText.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullText.DOCUMENT_FULL_TEXT.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_FOREIGN_KEY_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT, new OrderField[] { TableForeignKeyDocument.TABLE_FOREIGN_KEY_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 PROJECT_SYNC_TASK_IDX_USER_ID = Internal.createIndex(DSL.name("idx_user_id"), ProjectSyncTask.PROJECT_SYNC_TASK, new OrderField[] { ProjectSyncTask.PROJECT_SYNC_TASK.USER_ID }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_COLUMN = Internal.createIndex(DSL.name("FIDX_COLUMN"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.COL_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.COL_COMMENT, DocumentFullTextTable.DOCUMENT_FULL_TEXT.COL_DESCRIPTION, DocumentFullTextTable.DOCUMENT_FULL_TEXT.DATABASE_PRODUCT_NAME }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_GROUP = Internal.createIndex(DSL.name("FIDX_GROUP"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.GROUP_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.GROUP_DESCRIPTION }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_PROJECT = Internal.createIndex(DSL.name("FIDX_PROJECT"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.PROJECT_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.PROJECT_DESCRIPTION, DocumentFullTextTable.DOCUMENT_FULL_TEXT.SCHEMA_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.DATABASE_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.DATABASE_TYPE }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_FIDX_TABLE = Internal.createIndex(DSL.name("FIDX_TABLE"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.TABLE_NAME, DocumentFullTextTable.DOCUMENT_FULL_TEXT.TABLE_COMMENT, DocumentFullTextTable.DOCUMENT_FULL_TEXT.TABLE_DESCRIPTION, DocumentFullTextTable.DOCUMENT_FULL_TEXT.DATABASE_PRODUCT_NAME }, false);
|
||||
public static final Index DATA_SOURCE_PROPERTY_IDX_DATA_SOURCE_ID = Internal.createIndex(DSL.name("idx_data_source_id"), DataSourcePropertyTable.DATA_SOURCE_PROPERTY, new OrderField[] { DataSourcePropertyTable.DATA_SOURCE_PROPERTY.DATA_SOURCE_ID }, false);
|
||||
public static final Index TABLE_COLUMN_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableDocumentTable.TABLE_DOCUMENT, new OrderField[] { TableDocumentTable.TABLE_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_FOREIGN_KEY_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT, new OrderField[] { TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_INDEX_DOCUMENT_IDX_DATABASE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_database_document_id"), TableIndexDocumentTable.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocumentTable.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"), TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT.DATABASE_DOCUMENT_ID }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_IDX_GROUP_ID = Internal.createIndex(DSL.name("IDX_GROUP_ID"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.GROUP_ID }, false);
|
||||
public static final Index DOCUMENT_DISCUSSION_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), DocumentDiscussionTable.DOCUMENT_DISCUSSION, new OrderField[] { DocumentDiscussionTable.DOCUMENT_DISCUSSION.PROJECT_ID }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_IDX_PROJECT_ID = Internal.createIndex(DSL.name("IDX_PROJECT_ID"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.PROJECT_ID }, false);
|
||||
public static final Index PROJECT_SYNC_TASK_IDX_PROJECT_ID = Internal.createIndex(DSL.name("idx_project_id"), ProjectSyncTaskTable.PROJECT_SYNC_TASK, new OrderField[] { ProjectSyncTaskTable.PROJECT_SYNC_TASK.PROJECT_ID }, false);
|
||||
public static final Index DOCUMENT_FULL_TEXT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("IDX_TABLE_DOCUMENT_ID"), DocumentFullTextTable.DOCUMENT_FULL_TEXT, new OrderField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.TABLE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_COLUMN_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT, new OrderField[] { TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_FOREIGN_KEY_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT, new OrderField[] { TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||
public static final Index TABLE_INDEX_DOCUMENT_IDX_TABLE_DOCUMENT_ID = Internal.createIndex(DSL.name("idx_table_document_id"), TableIndexDocumentTable.TABLE_INDEX_DOCUMENT, new OrderField[] { TableIndexDocumentTable.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"), TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT, new OrderField[] { TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT.TABLE_DOCUMENT_ID }, false);
|
||||
public static final Index PROJECT_SYNC_TASK_IDX_USER_ID = Internal.createIndex(DSL.name("idx_user_id"), ProjectSyncTaskTable.PROJECT_SYNC_TASK, new OrderField[] { ProjectSyncTaskTable.PROJECT_SYNC_TASK.USER_ID }, false);
|
||||
}
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
package com.databasir.dao;
|
||||
|
||||
|
||||
import com.databasir.dao.tables.DataSource;
|
||||
import com.databasir.dao.tables.DataSourceProperty;
|
||||
import com.databasir.dao.tables.DatabaseDocument;
|
||||
import com.databasir.dao.tables.DatabaseType;
|
||||
import com.databasir.dao.tables.DocumentDescription;
|
||||
import com.databasir.dao.tables.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.DocumentFullText;
|
||||
import com.databasir.dao.tables.DocumentTemplateProperty;
|
||||
import com.databasir.dao.tables.Group;
|
||||
import com.databasir.dao.tables.Login;
|
||||
import com.databasir.dao.tables.MockDataRule;
|
||||
import com.databasir.dao.tables.OauthApp;
|
||||
import com.databasir.dao.tables.OperationLog;
|
||||
import com.databasir.dao.tables.Project;
|
||||
import com.databasir.dao.tables.ProjectSyncRule;
|
||||
import com.databasir.dao.tables.ProjectSyncTask;
|
||||
import com.databasir.dao.tables.SysKey;
|
||||
import com.databasir.dao.tables.SysMail;
|
||||
import com.databasir.dao.tables.TableColumnDocument;
|
||||
import com.databasir.dao.tables.TableDocument;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocument;
|
||||
import com.databasir.dao.tables.TableIndexDocument;
|
||||
import com.databasir.dao.tables.TableTriggerDocument;
|
||||
import com.databasir.dao.tables.User;
|
||||
import com.databasir.dao.tables.UserFavoriteProject;
|
||||
import com.databasir.dao.tables.UserRole;
|
||||
import com.databasir.dao.tables.DataSourcePropertyTable;
|
||||
import com.databasir.dao.tables.DataSourceTable;
|
||||
import com.databasir.dao.tables.DatabaseDocumentTable;
|
||||
import com.databasir.dao.tables.DatabaseTypeTable;
|
||||
import com.databasir.dao.tables.DocumentDescriptionTable;
|
||||
import com.databasir.dao.tables.DocumentDiscussionTable;
|
||||
import com.databasir.dao.tables.DocumentFullTextTable;
|
||||
import com.databasir.dao.tables.DocumentTemplatePropertyTable;
|
||||
import com.databasir.dao.tables.GroupTable;
|
||||
import com.databasir.dao.tables.LoginTable;
|
||||
import com.databasir.dao.tables.MockDataRuleTable;
|
||||
import com.databasir.dao.tables.OauthAppTable;
|
||||
import com.databasir.dao.tables.OperationLogTable;
|
||||
import com.databasir.dao.tables.ProjectSyncRuleTable;
|
||||
import com.databasir.dao.tables.ProjectSyncTaskTable;
|
||||
import com.databasir.dao.tables.ProjectTable;
|
||||
import com.databasir.dao.tables.SysKeyTable;
|
||||
import com.databasir.dao.tables.SysMailTable;
|
||||
import com.databasir.dao.tables.TableColumnDocumentTable;
|
||||
import com.databasir.dao.tables.TableDocumentTable;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocumentTable;
|
||||
import com.databasir.dao.tables.TableIndexDocumentTable;
|
||||
import com.databasir.dao.tables.TableTriggerDocumentTable;
|
||||
import com.databasir.dao.tables.UserFavoriteProjectTable;
|
||||
import com.databasir.dao.tables.UserRoleTable;
|
||||
import com.databasir.dao.tables.UserTable;
|
||||
import com.databasir.dao.tables.records.DataSourcePropertyRecord;
|
||||
import com.databasir.dao.tables.records.DataSourceRecord;
|
||||
import com.databasir.dao.tables.records.DatabaseDocumentRecord;
|
||||
|
@ -74,44 +74,44 @@ public class Keys {
|
|||
// UNIQUE and PRIMARY KEY definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static final UniqueKey<DataSourceRecord> KEY_DATA_SOURCE_PRIMARY = Internal.createUniqueKey(DataSource.DATA_SOURCE, DSL.name("KEY_data_source_PRIMARY"), new TableField[] { DataSource.DATA_SOURCE.ID }, true);
|
||||
public static final UniqueKey<DataSourceRecord> KEY_DATA_SOURCE_UK_PROJECT_ID = Internal.createUniqueKey(DataSource.DATA_SOURCE, DSL.name("KEY_data_source_uk_project_id"), new TableField[] { DataSource.DATA_SOURCE.PROJECT_ID }, true);
|
||||
public static final UniqueKey<DataSourcePropertyRecord> KEY_DATA_SOURCE_PROPERTY_PRIMARY = Internal.createUniqueKey(DataSourceProperty.DATA_SOURCE_PROPERTY, DSL.name("KEY_data_source_property_PRIMARY"), new TableField[] { DataSourceProperty.DATA_SOURCE_PROPERTY.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<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_UK_PROJECT_ID_VERSION_IS_ARCHIVE = Internal.createUniqueKey(DatabaseDocument.DATABASE_DOCUMENT, DSL.name("KEY_database_document_uk_project_id_version_is_archive"), new TableField[] { DatabaseDocument.DATABASE_DOCUMENT.PROJECT_ID, DatabaseDocument.DATABASE_DOCUMENT.VERSION, DatabaseDocument.DATABASE_DOCUMENT.IS_ARCHIVE }, 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<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_PRIMARY = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_PRIMARY"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.ID }, true);
|
||||
public static final UniqueKey<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(DocumentDescription.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_uk_project_id_table_name_column_name"), new TableField[] { DocumentDescription.DOCUMENT_DESCRIPTION.PROJECT_ID, DocumentDescription.DOCUMENT_DESCRIPTION.TABLE_NAME, DocumentDescription.DOCUMENT_DESCRIPTION.COLUMN_NAME }, 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<DocumentFullTextRecord> KEY_DOCUMENT_FULL_TEXT_PRIMARY = Internal.createUniqueKey(DocumentFullText.DOCUMENT_FULL_TEXT, DSL.name("KEY_document_full_text_PRIMARY"), new TableField[] { DocumentFullText.DOCUMENT_FULL_TEXT.ID }, true);
|
||||
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_PRIMARY"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.ID }, true);
|
||||
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY = Internal.createUniqueKey(DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_uk_type_key"), new TableField[] { DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.TYPE, DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY.KEY }, 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_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<MockDataRuleRecord> KEY_MOCK_DATA_RULE_PRIMARY = Internal.createUniqueKey(MockDataRule.MOCK_DATA_RULE, DSL.name("KEY_mock_data_rule_PRIMARY"), new TableField[] { MockDataRule.MOCK_DATA_RULE.ID }, true);
|
||||
public static final UniqueKey<MockDataRuleRecord> KEY_MOCK_DATA_RULE_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(MockDataRule.MOCK_DATA_RULE, DSL.name("KEY_mock_data_rule_uk_project_id_table_name_column_name"), new TableField[] { MockDataRule.MOCK_DATA_RULE.PROJECT_ID, MockDataRule.MOCK_DATA_RULE.TABLE_NAME, MockDataRule.MOCK_DATA_RULE.COLUMN_NAME }, true);
|
||||
public static final UniqueKey<OauthAppRecord> KEY_OAUTH_APP_PRIMARY = Internal.createUniqueKey(OauthApp.OAUTH_APP, DSL.name("KEY_oauth_app_PRIMARY"), new TableField[] { OauthApp.OAUTH_APP.ID }, true);
|
||||
public static final UniqueKey<OauthAppRecord> KEY_OAUTH_APP_UK_REGISTRATION_ID = Internal.createUniqueKey(OauthApp.OAUTH_APP, DSL.name("KEY_oauth_app_uk_registration_id"), new TableField[] { OauthApp.OAUTH_APP.REGISTRATION_ID }, true);
|
||||
public static final UniqueKey<OperationLogRecord> KEY_OPERATION_LOG_PRIMARY = Internal.createUniqueKey(OperationLog.OPERATION_LOG, DSL.name("KEY_operation_log_PRIMARY"), new TableField[] { OperationLog.OPERATION_LOG.ID }, true);
|
||||
public static final UniqueKey<ProjectRecord> KEY_PROJECT_PRIMARY = Internal.createUniqueKey(Project.PROJECT, DSL.name("KEY_project_PRIMARY"), new TableField[] { Project.PROJECT.ID }, true);
|
||||
public static final UniqueKey<ProjectRecord> KEY_PROJECT_UK_GROUP_ID_NAME_DELETED_TOKEN = Internal.createUniqueKey(Project.PROJECT, DSL.name("KEY_project_uk_group_id_name_deleted_token"), new TableField[] { Project.PROJECT.GROUP_ID, Project.PROJECT.NAME, Project.PROJECT.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<ProjectSyncRuleRecord> KEY_PROJECT_SYNC_RULE_PRIMARY = Internal.createUniqueKey(ProjectSyncRule.PROJECT_SYNC_RULE, DSL.name("KEY_project_sync_rule_PRIMARY"), new TableField[] { ProjectSyncRule.PROJECT_SYNC_RULE.ID }, true);
|
||||
public static final UniqueKey<ProjectSyncRuleRecord> KEY_PROJECT_SYNC_RULE_UK_PROJECT_ID = Internal.createUniqueKey(ProjectSyncRule.PROJECT_SYNC_RULE, DSL.name("KEY_project_sync_rule_uk_project_id"), new TableField[] { ProjectSyncRule.PROJECT_SYNC_RULE.PROJECT_ID }, true);
|
||||
public static final UniqueKey<ProjectSyncTaskRecord> KEY_PROJECT_SYNC_TASK_PRIMARY = Internal.createUniqueKey(ProjectSyncTask.PROJECT_SYNC_TASK, DSL.name("KEY_project_sync_task_PRIMARY"), new TableField[] { ProjectSyncTask.PROJECT_SYNC_TASK.ID }, true);
|
||||
public static final UniqueKey<SysKeyRecord> KEY_SYS_KEY_PRIMARY = Internal.createUniqueKey(SysKey.SYS_KEY, DSL.name("KEY_sys_key_PRIMARY"), new TableField[] { SysKey.SYS_KEY.ID }, true);
|
||||
public static final UniqueKey<SysMailRecord> KEY_SYS_MAIL_PRIMARY = Internal.createUniqueKey(SysMail.SYS_MAIL, DSL.name("KEY_sys_mail_PRIMARY"), new TableField[] { SysMail.SYS_MAIL.ID }, true);
|
||||
public static final UniqueKey<TableColumnDocumentRecord> KEY_TABLE_COLUMN_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableColumnDocument.TABLE_COLUMN_DOCUMENT, DSL.name("KEY_table_column_document_PRIMARY"), new TableField[] { TableColumnDocument.TABLE_COLUMN_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableDocumentRecord> KEY_TABLE_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableDocument.TABLE_DOCUMENT, DSL.name("KEY_table_document_PRIMARY"), new TableField[] { TableDocument.TABLE_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableForeignKeyDocumentRecord> KEY_TABLE_FOREIGN_KEY_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT, DSL.name("KEY_table_foreign_key_document_PRIMARY"), new TableField[] { TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableIndexDocumentRecord> KEY_TABLE_INDEX_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableIndexDocument.TABLE_INDEX_DOCUMENT, DSL.name("KEY_table_index_document_PRIMARY"), new TableField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableTriggerDocumentRecord> KEY_TABLE_TRIGGER_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, DSL.name("KEY_table_trigger_document_PRIMARY"), new TableField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_PRIMARY = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_PRIMARY"), new TableField[] { User.USER.ID }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_UK_EMAIL = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_email"), new TableField[] { User.USER.EMAIL, User.USER.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_UK_USERNAME = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_username"), new TableField[] { User.USER.USERNAME, User.USER.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_PRIMARY = Internal.createUniqueKey(UserFavoriteProject.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_PRIMARY"), new TableField[] { UserFavoriteProject.USER_FAVORITE_PROJECT.ID }, true);
|
||||
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_UK_USER_ID_PROJECT_ID = Internal.createUniqueKey(UserFavoriteProject.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_uk_user_id_project_id"), new TableField[] { UserFavoriteProject.USER_FAVORITE_PROJECT.USER_ID, UserFavoriteProject.USER_FAVORITE_PROJECT.PROJECT_ID }, true);
|
||||
public static final UniqueKey<UserRoleRecord> KEY_USER_ROLE_PRIMARY = Internal.createUniqueKey(UserRole.USER_ROLE, DSL.name("KEY_user_role_PRIMARY"), new TableField[] { UserRole.USER_ROLE.ID }, true);
|
||||
public static final UniqueKey<UserRoleRecord> KEY_USER_ROLE_UK_USER_ID_GROUP_ID_ROLE = Internal.createUniqueKey(UserRole.USER_ROLE, DSL.name("KEY_user_role_uk_user_id_group_id_role"), new TableField[] { UserRole.USER_ROLE.USER_ID, UserRole.USER_ROLE.GROUP_ID, UserRole.USER_ROLE.ROLE }, true);
|
||||
public static final UniqueKey<DataSourceRecord> KEY_DATA_SOURCE_PRIMARY = Internal.createUniqueKey(DataSourceTable.DATA_SOURCE, DSL.name("KEY_data_source_PRIMARY"), new TableField[] { DataSourceTable.DATA_SOURCE.ID }, true);
|
||||
public static final UniqueKey<DataSourceRecord> KEY_DATA_SOURCE_UK_PROJECT_ID = Internal.createUniqueKey(DataSourceTable.DATA_SOURCE, DSL.name("KEY_data_source_uk_project_id"), new TableField[] { DataSourceTable.DATA_SOURCE.PROJECT_ID }, true);
|
||||
public static final UniqueKey<DataSourcePropertyRecord> KEY_DATA_SOURCE_PROPERTY_PRIMARY = Internal.createUniqueKey(DataSourcePropertyTable.DATA_SOURCE_PROPERTY, DSL.name("KEY_data_source_property_PRIMARY"), new TableField[] { DataSourcePropertyTable.DATA_SOURCE_PROPERTY.ID }, true);
|
||||
public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_PRIMARY = Internal.createUniqueKey(DatabaseDocumentTable.DATABASE_DOCUMENT, DSL.name("KEY_database_document_PRIMARY"), new TableField[] { DatabaseDocumentTable.DATABASE_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<DatabaseDocumentRecord> KEY_DATABASE_DOCUMENT_UK_PROJECT_ID_VERSION_IS_ARCHIVE = Internal.createUniqueKey(DatabaseDocumentTable.DATABASE_DOCUMENT, DSL.name("KEY_database_document_uk_project_id_version_is_archive"), new TableField[] { DatabaseDocumentTable.DATABASE_DOCUMENT.PROJECT_ID, DatabaseDocumentTable.DATABASE_DOCUMENT.VERSION, DatabaseDocumentTable.DATABASE_DOCUMENT.IS_ARCHIVE }, true);
|
||||
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_PRIMARY = Internal.createUniqueKey(DatabaseTypeTable.DATABASE_TYPE, DSL.name("KEY_database_type_PRIMARY"), new TableField[] { DatabaseTypeTable.DATABASE_TYPE.ID }, true);
|
||||
public static final UniqueKey<DatabaseTypeRecord> KEY_DATABASE_TYPE_UK_DATABASE_TYPE_DELETED_DELETED_TOKEN = Internal.createUniqueKey(DatabaseTypeTable.DATABASE_TYPE, DSL.name("KEY_database_type_uk_database_type_deleted_deleted_token"), new TableField[] { DatabaseTypeTable.DATABASE_TYPE.DATABASE_TYPE_, DatabaseTypeTable.DATABASE_TYPE.DELETED, DatabaseTypeTable.DATABASE_TYPE.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_PRIMARY = Internal.createUniqueKey(DocumentDescriptionTable.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_PRIMARY"), new TableField[] { DocumentDescriptionTable.DOCUMENT_DESCRIPTION.ID }, true);
|
||||
public static final UniqueKey<DocumentDescriptionRecord> KEY_DOCUMENT_DESCRIPTION_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(DocumentDescriptionTable.DOCUMENT_DESCRIPTION, DSL.name("KEY_document_description_uk_project_id_table_name_column_name"), new TableField[] { DocumentDescriptionTable.DOCUMENT_DESCRIPTION.PROJECT_ID, DocumentDescriptionTable.DOCUMENT_DESCRIPTION.TABLE_NAME, DocumentDescriptionTable.DOCUMENT_DESCRIPTION.COLUMN_NAME }, true);
|
||||
public static final UniqueKey<DocumentDiscussionRecord> KEY_DOCUMENT_DISCUSSION_PRIMARY = Internal.createUniqueKey(DocumentDiscussionTable.DOCUMENT_DISCUSSION, DSL.name("KEY_document_discussion_PRIMARY"), new TableField[] { DocumentDiscussionTable.DOCUMENT_DISCUSSION.ID }, true);
|
||||
public static final UniqueKey<DocumentFullTextRecord> KEY_DOCUMENT_FULL_TEXT_PRIMARY = Internal.createUniqueKey(DocumentFullTextTable.DOCUMENT_FULL_TEXT, DSL.name("KEY_document_full_text_PRIMARY"), new TableField[] { DocumentFullTextTable.DOCUMENT_FULL_TEXT.ID }, true);
|
||||
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_PRIMARY = Internal.createUniqueKey(DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_PRIMARY"), new TableField[] { DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY.ID }, true);
|
||||
public static final UniqueKey<DocumentTemplatePropertyRecord> KEY_DOCUMENT_TEMPLATE_PROPERTY_UK_TYPE_KEY = Internal.createUniqueKey(DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY, DSL.name("KEY_document_template_property_uk_type_key"), new TableField[] { DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY.TYPE, DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY.KEY }, true);
|
||||
public static final UniqueKey<GroupRecord> KEY_GROUP_PRIMARY = Internal.createUniqueKey(GroupTable.GROUP, DSL.name("KEY_group_PRIMARY"), new TableField[] { GroupTable.GROUP.ID }, true);
|
||||
public static final UniqueKey<LoginRecord> KEY_LOGIN_PRIMARY = Internal.createUniqueKey(LoginTable.LOGIN, DSL.name("KEY_login_PRIMARY"), new TableField[] { LoginTable.LOGIN.ID }, true);
|
||||
public static final UniqueKey<LoginRecord> KEY_LOGIN_UK_USER_ID = Internal.createUniqueKey(LoginTable.LOGIN, DSL.name("KEY_login_uk_user_id"), new TableField[] { LoginTable.LOGIN.USER_ID }, true);
|
||||
public static final UniqueKey<MockDataRuleRecord> KEY_MOCK_DATA_RULE_PRIMARY = Internal.createUniqueKey(MockDataRuleTable.MOCK_DATA_RULE, DSL.name("KEY_mock_data_rule_PRIMARY"), new TableField[] { MockDataRuleTable.MOCK_DATA_RULE.ID }, true);
|
||||
public static final UniqueKey<MockDataRuleRecord> KEY_MOCK_DATA_RULE_UK_PROJECT_ID_TABLE_NAME_COLUMN_NAME = Internal.createUniqueKey(MockDataRuleTable.MOCK_DATA_RULE, DSL.name("KEY_mock_data_rule_uk_project_id_table_name_column_name"), new TableField[] { MockDataRuleTable.MOCK_DATA_RULE.PROJECT_ID, MockDataRuleTable.MOCK_DATA_RULE.TABLE_NAME, MockDataRuleTable.MOCK_DATA_RULE.COLUMN_NAME }, true);
|
||||
public static final UniqueKey<OauthAppRecord> KEY_OAUTH_APP_PRIMARY = Internal.createUniqueKey(OauthAppTable.OAUTH_APP, DSL.name("KEY_oauth_app_PRIMARY"), new TableField[] { OauthAppTable.OAUTH_APP.ID }, true);
|
||||
public static final UniqueKey<OauthAppRecord> KEY_OAUTH_APP_UK_REGISTRATION_ID = Internal.createUniqueKey(OauthAppTable.OAUTH_APP, DSL.name("KEY_oauth_app_uk_registration_id"), new TableField[] { OauthAppTable.OAUTH_APP.REGISTRATION_ID }, true);
|
||||
public static final UniqueKey<OperationLogRecord> KEY_OPERATION_LOG_PRIMARY = Internal.createUniqueKey(OperationLogTable.OPERATION_LOG, DSL.name("KEY_operation_log_PRIMARY"), new TableField[] { OperationLogTable.OPERATION_LOG.ID }, true);
|
||||
public static final UniqueKey<ProjectRecord> KEY_PROJECT_PRIMARY = Internal.createUniqueKey(ProjectTable.PROJECT, DSL.name("KEY_project_PRIMARY"), new TableField[] { ProjectTable.PROJECT.ID }, true);
|
||||
public static final UniqueKey<ProjectRecord> KEY_PROJECT_UK_GROUP_ID_NAME_DELETED_TOKEN = Internal.createUniqueKey(ProjectTable.PROJECT, DSL.name("KEY_project_uk_group_id_name_deleted_token"), new TableField[] { ProjectTable.PROJECT.GROUP_ID, ProjectTable.PROJECT.NAME, ProjectTable.PROJECT.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<ProjectSyncRuleRecord> KEY_PROJECT_SYNC_RULE_PRIMARY = Internal.createUniqueKey(ProjectSyncRuleTable.PROJECT_SYNC_RULE, DSL.name("KEY_project_sync_rule_PRIMARY"), new TableField[] { ProjectSyncRuleTable.PROJECT_SYNC_RULE.ID }, true);
|
||||
public static final UniqueKey<ProjectSyncRuleRecord> KEY_PROJECT_SYNC_RULE_UK_PROJECT_ID = Internal.createUniqueKey(ProjectSyncRuleTable.PROJECT_SYNC_RULE, DSL.name("KEY_project_sync_rule_uk_project_id"), new TableField[] { ProjectSyncRuleTable.PROJECT_SYNC_RULE.PROJECT_ID }, true);
|
||||
public static final UniqueKey<ProjectSyncTaskRecord> KEY_PROJECT_SYNC_TASK_PRIMARY = Internal.createUniqueKey(ProjectSyncTaskTable.PROJECT_SYNC_TASK, DSL.name("KEY_project_sync_task_PRIMARY"), new TableField[] { ProjectSyncTaskTable.PROJECT_SYNC_TASK.ID }, true);
|
||||
public static final UniqueKey<SysKeyRecord> KEY_SYS_KEY_PRIMARY = Internal.createUniqueKey(SysKeyTable.SYS_KEY, DSL.name("KEY_sys_key_PRIMARY"), new TableField[] { SysKeyTable.SYS_KEY.ID }, true);
|
||||
public static final UniqueKey<SysMailRecord> KEY_SYS_MAIL_PRIMARY = Internal.createUniqueKey(SysMailTable.SYS_MAIL, DSL.name("KEY_sys_mail_PRIMARY"), new TableField[] { SysMailTable.SYS_MAIL.ID }, true);
|
||||
public static final UniqueKey<TableColumnDocumentRecord> KEY_TABLE_COLUMN_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT, DSL.name("KEY_table_column_document_PRIMARY"), new TableField[] { TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableDocumentRecord> KEY_TABLE_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableDocumentTable.TABLE_DOCUMENT, DSL.name("KEY_table_document_PRIMARY"), new TableField[] { TableDocumentTable.TABLE_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableForeignKeyDocumentRecord> KEY_TABLE_FOREIGN_KEY_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT, DSL.name("KEY_table_foreign_key_document_PRIMARY"), new TableField[] { TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableIndexDocumentRecord> KEY_TABLE_INDEX_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableIndexDocumentTable.TABLE_INDEX_DOCUMENT, DSL.name("KEY_table_index_document_PRIMARY"), new TableField[] { TableIndexDocumentTable.TABLE_INDEX_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<TableTriggerDocumentRecord> KEY_TABLE_TRIGGER_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT, DSL.name("KEY_table_trigger_document_PRIMARY"), new TableField[] { TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT.ID }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_PRIMARY = Internal.createUniqueKey(UserTable.USER, DSL.name("KEY_user_PRIMARY"), new TableField[] { UserTable.USER.ID }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_UK_EMAIL = Internal.createUniqueKey(UserTable.USER, DSL.name("KEY_user_uk_email"), new TableField[] { UserTable.USER.EMAIL, UserTable.USER.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<UserRecord> KEY_USER_UK_USERNAME = Internal.createUniqueKey(UserTable.USER, DSL.name("KEY_user_uk_username"), new TableField[] { UserTable.USER.USERNAME, UserTable.USER.DELETED_TOKEN }, true);
|
||||
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_PRIMARY = Internal.createUniqueKey(UserFavoriteProjectTable.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_PRIMARY"), new TableField[] { UserFavoriteProjectTable.USER_FAVORITE_PROJECT.ID }, true);
|
||||
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_UK_USER_ID_PROJECT_ID = Internal.createUniqueKey(UserFavoriteProjectTable.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_uk_user_id_project_id"), new TableField[] { UserFavoriteProjectTable.USER_FAVORITE_PROJECT.USER_ID, UserFavoriteProjectTable.USER_FAVORITE_PROJECT.PROJECT_ID }, true);
|
||||
public static final UniqueKey<UserRoleRecord> KEY_USER_ROLE_PRIMARY = Internal.createUniqueKey(UserRoleTable.USER_ROLE, DSL.name("KEY_user_role_PRIMARY"), new TableField[] { UserRoleTable.USER_ROLE.ID }, true);
|
||||
public static final UniqueKey<UserRoleRecord> KEY_USER_ROLE_UK_USER_ID_GROUP_ID_ROLE = Internal.createUniqueKey(UserRoleTable.USER_ROLE, DSL.name("KEY_user_role_uk_user_id_group_id_role"), new TableField[] { UserRoleTable.USER_ROLE.USER_ID, UserRoleTable.USER_ROLE.GROUP_ID, UserRoleTable.USER_ROLE.ROLE }, true);
|
||||
}
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
package com.databasir.dao;
|
||||
|
||||
|
||||
import com.databasir.dao.tables.DataSource;
|
||||
import com.databasir.dao.tables.DataSourceProperty;
|
||||
import com.databasir.dao.tables.DatabaseDocument;
|
||||
import com.databasir.dao.tables.DatabaseType;
|
||||
import com.databasir.dao.tables.DocumentDescription;
|
||||
import com.databasir.dao.tables.DocumentDiscussion;
|
||||
import com.databasir.dao.tables.DocumentFullText;
|
||||
import com.databasir.dao.tables.DocumentTemplateProperty;
|
||||
import com.databasir.dao.tables.Group;
|
||||
import com.databasir.dao.tables.Login;
|
||||
import com.databasir.dao.tables.MockDataRule;
|
||||
import com.databasir.dao.tables.OauthApp;
|
||||
import com.databasir.dao.tables.OperationLog;
|
||||
import com.databasir.dao.tables.Project;
|
||||
import com.databasir.dao.tables.ProjectSyncRule;
|
||||
import com.databasir.dao.tables.ProjectSyncTask;
|
||||
import com.databasir.dao.tables.SysKey;
|
||||
import com.databasir.dao.tables.SysMail;
|
||||
import com.databasir.dao.tables.TableColumnDocument;
|
||||
import com.databasir.dao.tables.TableDocument;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocument;
|
||||
import com.databasir.dao.tables.TableIndexDocument;
|
||||
import com.databasir.dao.tables.TableTriggerDocument;
|
||||
import com.databasir.dao.tables.User;
|
||||
import com.databasir.dao.tables.UserFavoriteProject;
|
||||
import com.databasir.dao.tables.UserRole;
|
||||
import com.databasir.dao.tables.DataSourcePropertyTable;
|
||||
import com.databasir.dao.tables.DataSourceTable;
|
||||
import com.databasir.dao.tables.DatabaseDocumentTable;
|
||||
import com.databasir.dao.tables.DatabaseTypeTable;
|
||||
import com.databasir.dao.tables.DocumentDescriptionTable;
|
||||
import com.databasir.dao.tables.DocumentDiscussionTable;
|
||||
import com.databasir.dao.tables.DocumentFullTextTable;
|
||||
import com.databasir.dao.tables.DocumentTemplatePropertyTable;
|
||||
import com.databasir.dao.tables.GroupTable;
|
||||
import com.databasir.dao.tables.LoginTable;
|
||||
import com.databasir.dao.tables.MockDataRuleTable;
|
||||
import com.databasir.dao.tables.OauthAppTable;
|
||||
import com.databasir.dao.tables.OperationLogTable;
|
||||
import com.databasir.dao.tables.ProjectSyncRuleTable;
|
||||
import com.databasir.dao.tables.ProjectSyncTaskTable;
|
||||
import com.databasir.dao.tables.ProjectTable;
|
||||
import com.databasir.dao.tables.SysKeyTable;
|
||||
import com.databasir.dao.tables.SysMailTable;
|
||||
import com.databasir.dao.tables.TableColumnDocumentTable;
|
||||
import com.databasir.dao.tables.TableDocumentTable;
|
||||
import com.databasir.dao.tables.TableForeignKeyDocumentTable;
|
||||
import com.databasir.dao.tables.TableIndexDocumentTable;
|
||||
import com.databasir.dao.tables.TableTriggerDocumentTable;
|
||||
import com.databasir.dao.tables.UserFavoriteProjectTable;
|
||||
import com.databasir.dao.tables.UserRoleTable;
|
||||
import com.databasir.dao.tables.UserTable;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -41,130 +41,130 @@ public class Tables {
|
|||
/**
|
||||
* The table <code>databasir.data_source</code>.
|
||||
*/
|
||||
public static final DataSource DATA_SOURCE = DataSource.DATA_SOURCE;
|
||||
public static final DataSourceTable DATA_SOURCE = DataSourceTable.DATA_SOURCE;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.data_source_property</code>.
|
||||
*/
|
||||
public static final DataSourceProperty DATA_SOURCE_PROPERTY = DataSourceProperty.DATA_SOURCE_PROPERTY;
|
||||
public static final DataSourcePropertyTable DATA_SOURCE_PROPERTY = DataSourcePropertyTable.DATA_SOURCE_PROPERTY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.database_document</code>.
|
||||
*/
|
||||
public static final DatabaseDocument DATABASE_DOCUMENT = DatabaseDocument.DATABASE_DOCUMENT;
|
||||
public static final DatabaseDocumentTable DATABASE_DOCUMENT = DatabaseDocumentTable.DATABASE_DOCUMENT;
|
||||
|
||||
/**
|
||||
* customer database types
|
||||
*/
|
||||
public static final DatabaseType DATABASE_TYPE = DatabaseType.DATABASE_TYPE;
|
||||
public static final DatabaseTypeTable DATABASE_TYPE = DatabaseTypeTable.DATABASE_TYPE;
|
||||
|
||||
/**
|
||||
* custom document description
|
||||
*/
|
||||
public static final DocumentDescription DOCUMENT_DESCRIPTION = DocumentDescription.DOCUMENT_DESCRIPTION;
|
||||
public static final DocumentDescriptionTable DOCUMENT_DESCRIPTION = DocumentDescriptionTable.DOCUMENT_DESCRIPTION;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.document_discussion</code>.
|
||||
*/
|
||||
public static final DocumentDiscussion DOCUMENT_DISCUSSION = DocumentDiscussion.DOCUMENT_DISCUSSION;
|
||||
public static final DocumentDiscussionTable DOCUMENT_DISCUSSION = DocumentDiscussionTable.DOCUMENT_DISCUSSION;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.document_full_text</code>.
|
||||
*/
|
||||
public static final DocumentFullText DOCUMENT_FULL_TEXT = DocumentFullText.DOCUMENT_FULL_TEXT;
|
||||
public static final DocumentFullTextTable DOCUMENT_FULL_TEXT = DocumentFullTextTable.DOCUMENT_FULL_TEXT;
|
||||
|
||||
/**
|
||||
* template property
|
||||
*/
|
||||
public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplateProperty.DOCUMENT_TEMPLATE_PROPERTY;
|
||||
public static final DocumentTemplatePropertyTable DOCUMENT_TEMPLATE_PROPERTY = DocumentTemplatePropertyTable.DOCUMENT_TEMPLATE_PROPERTY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.group</code>.
|
||||
*/
|
||||
public static final Group GROUP = Group.GROUP;
|
||||
public static final GroupTable GROUP = GroupTable.GROUP;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.login</code>.
|
||||
*/
|
||||
public static final Login LOGIN = Login.LOGIN;
|
||||
public static final LoginTable LOGIN = LoginTable.LOGIN;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.mock_data_rule</code>.
|
||||
*/
|
||||
public static final MockDataRule MOCK_DATA_RULE = MockDataRule.MOCK_DATA_RULE;
|
||||
public static final MockDataRuleTable MOCK_DATA_RULE = MockDataRuleTable.MOCK_DATA_RULE;
|
||||
|
||||
/**
|
||||
* oauth app info
|
||||
*/
|
||||
public static final OauthApp OAUTH_APP = OauthApp.OAUTH_APP;
|
||||
public static final OauthAppTable OAUTH_APP = OauthAppTable.OAUTH_APP;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.operation_log</code>.
|
||||
*/
|
||||
public static final OperationLog OPERATION_LOG = OperationLog.OPERATION_LOG;
|
||||
public static final OperationLogTable OPERATION_LOG = OperationLogTable.OPERATION_LOG;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project</code>.
|
||||
*/
|
||||
public static final Project PROJECT = Project.PROJECT;
|
||||
public static final ProjectTable PROJECT = ProjectTable.PROJECT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project_sync_rule</code>.
|
||||
*/
|
||||
public static final ProjectSyncRule PROJECT_SYNC_RULE = ProjectSyncRule.PROJECT_SYNC_RULE;
|
||||
public static final ProjectSyncRuleTable PROJECT_SYNC_RULE = ProjectSyncRuleTable.PROJECT_SYNC_RULE;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.project_sync_task</code>.
|
||||
*/
|
||||
public static final ProjectSyncTask PROJECT_SYNC_TASK = ProjectSyncTask.PROJECT_SYNC_TASK;
|
||||
public static final ProjectSyncTaskTable PROJECT_SYNC_TASK = ProjectSyncTaskTable.PROJECT_SYNC_TASK;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.sys_key</code>.
|
||||
*/
|
||||
public static final SysKey SYS_KEY = SysKey.SYS_KEY;
|
||||
public static final SysKeyTable SYS_KEY = SysKeyTable.SYS_KEY;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.sys_mail</code>.
|
||||
*/
|
||||
public static final SysMail SYS_MAIL = SysMail.SYS_MAIL;
|
||||
public static final SysMailTable SYS_MAIL = SysMailTable.SYS_MAIL;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_column_document</code>.
|
||||
*/
|
||||
public static final TableColumnDocument TABLE_COLUMN_DOCUMENT = TableColumnDocument.TABLE_COLUMN_DOCUMENT;
|
||||
public static final TableColumnDocumentTable TABLE_COLUMN_DOCUMENT = TableColumnDocumentTable.TABLE_COLUMN_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_document</code>.
|
||||
*/
|
||||
public static final TableDocument TABLE_DOCUMENT = TableDocument.TABLE_DOCUMENT;
|
||||
public static final TableDocumentTable TABLE_DOCUMENT = TableDocumentTable.TABLE_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_foreign_key_document</code>.
|
||||
*/
|
||||
public static final TableForeignKeyDocument TABLE_FOREIGN_KEY_DOCUMENT = TableForeignKeyDocument.TABLE_FOREIGN_KEY_DOCUMENT;
|
||||
public static final TableForeignKeyDocumentTable TABLE_FOREIGN_KEY_DOCUMENT = TableForeignKeyDocumentTable.TABLE_FOREIGN_KEY_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_index_document</code>.
|
||||
*/
|
||||
public static final TableIndexDocument TABLE_INDEX_DOCUMENT = TableIndexDocument.TABLE_INDEX_DOCUMENT;
|
||||
public static final TableIndexDocumentTable TABLE_INDEX_DOCUMENT = TableIndexDocumentTable.TABLE_INDEX_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.table_trigger_document</code>.
|
||||
*/
|
||||
public static final TableTriggerDocument TABLE_TRIGGER_DOCUMENT = TableTriggerDocument.TABLE_TRIGGER_DOCUMENT;
|
||||
public static final TableTriggerDocumentTable TABLE_TRIGGER_DOCUMENT = TableTriggerDocumentTable.TABLE_TRIGGER_DOCUMENT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user</code>.
|
||||
*/
|
||||
public static final User USER = User.USER;
|
||||
public static final UserTable USER = UserTable.USER;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user_favorite_project</code>.
|
||||
*/
|
||||
public static final UserFavoriteProject USER_FAVORITE_PROJECT = UserFavoriteProject.USER_FAVORITE_PROJECT;
|
||||
public static final UserFavoriteProjectTable USER_FAVORITE_PROJECT = UserFavoriteProjectTable.USER_FAVORITE_PROJECT;
|
||||
|
||||
/**
|
||||
* The table <code>databasir.user_role</code>.
|
||||
*/
|
||||
public static final UserRole USER_ROLE = UserRole.USER_ROLE;
|
||||
public static final UserRoleTable USER_ROLE = UserRoleTable.USER_ROLE;
|
||||
}
|
||||
|
|
|
@ -34,14 +34,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DataSourceProperty extends TableImpl<DataSourcePropertyRecord> {
|
||||
public class DataSourcePropertyTable extends TableImpl<DataSourcePropertyRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.data_source_property</code>
|
||||
*/
|
||||
public static final DataSourceProperty DATA_SOURCE_PROPERTY = new DataSourceProperty();
|
||||
public static final DataSourcePropertyTable DATA_SOURCE_PROPERTY = new DataSourcePropertyTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -76,11 +76,11 @@ public class DataSourceProperty extends TableImpl<DataSourcePropertyRecord> {
|
|||
*/
|
||||
public final TableField<DataSourcePropertyRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DataSourceProperty(Name alias, Table<DataSourcePropertyRecord> aliased) {
|
||||
private DataSourcePropertyTable(Name alias, Table<DataSourcePropertyRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DataSourceProperty(Name alias, Table<DataSourcePropertyRecord> aliased, Field<?>[] parameters) {
|
||||
private DataSourcePropertyTable(Name alias, Table<DataSourcePropertyRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class DataSourceProperty extends TableImpl<DataSourcePropertyRecord> {
|
|||
* Create an aliased <code>databasir.data_source_property</code> table
|
||||
* reference
|
||||
*/
|
||||
public DataSourceProperty(String alias) {
|
||||
public DataSourcePropertyTable(String alias) {
|
||||
this(DSL.name(alias), DATA_SOURCE_PROPERTY);
|
||||
}
|
||||
|
||||
|
@ -96,18 +96,18 @@ public class DataSourceProperty extends TableImpl<DataSourcePropertyRecord> {
|
|||
* Create an aliased <code>databasir.data_source_property</code> table
|
||||
* reference
|
||||
*/
|
||||
public DataSourceProperty(Name alias) {
|
||||
public DataSourcePropertyTable(Name alias) {
|
||||
this(alias, DATA_SOURCE_PROPERTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.data_source_property</code> table reference
|
||||
*/
|
||||
public DataSourceProperty() {
|
||||
public DataSourcePropertyTable() {
|
||||
this(DSL.name("data_source_property"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DataSourceProperty(Table<O> child, ForeignKey<O, DataSourcePropertyRecord> key) {
|
||||
public <O extends Record> DataSourcePropertyTable(Table<O> child, ForeignKey<O, DataSourcePropertyRecord> key) {
|
||||
super(child, key, DATA_SOURCE_PROPERTY);
|
||||
}
|
||||
|
||||
|
@ -132,29 +132,29 @@ public class DataSourceProperty extends TableImpl<DataSourcePropertyRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSourceProperty as(String alias) {
|
||||
return new DataSourceProperty(DSL.name(alias), this);
|
||||
public DataSourcePropertyTable as(String alias) {
|
||||
return new DataSourcePropertyTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSourceProperty as(Name alias) {
|
||||
return new DataSourceProperty(alias, this);
|
||||
public DataSourcePropertyTable as(Name alias) {
|
||||
return new DataSourcePropertyTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DataSourceProperty rename(String name) {
|
||||
return new DataSourceProperty(DSL.name(name), null);
|
||||
public DataSourcePropertyTable rename(String name) {
|
||||
return new DataSourcePropertyTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DataSourceProperty rename(Name name) {
|
||||
return new DataSourceProperty(name, null);
|
||||
public DataSourcePropertyTable rename(Name name) {
|
||||
return new DataSourcePropertyTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -32,14 +32,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DataSource extends TableImpl<DataSourceRecord> {
|
||||
public class DataSourceTable extends TableImpl<DataSourceRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.data_source</code>
|
||||
*/
|
||||
public static final DataSource DATA_SOURCE = new DataSource();
|
||||
public static final DataSourceTable DATA_SOURCE = new DataSourceTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -99,36 +99,36 @@ public class DataSource extends TableImpl<DataSourceRecord> {
|
|||
*/
|
||||
public final TableField<DataSourceRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DataSource(Name alias, Table<DataSourceRecord> aliased) {
|
||||
private DataSourceTable(Name alias, Table<DataSourceRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DataSource(Name alias, Table<DataSourceRecord> aliased, Field<?>[] parameters) {
|
||||
private DataSourceTable(Name alias, Table<DataSourceRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.data_source</code> table reference
|
||||
*/
|
||||
public DataSource(String alias) {
|
||||
public DataSourceTable(String alias) {
|
||||
this(DSL.name(alias), DATA_SOURCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.data_source</code> table reference
|
||||
*/
|
||||
public DataSource(Name alias) {
|
||||
public DataSourceTable(Name alias) {
|
||||
this(alias, DATA_SOURCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.data_source</code> table reference
|
||||
*/
|
||||
public DataSource() {
|
||||
public DataSourceTable() {
|
||||
this(DSL.name("data_source"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DataSource(Table<O> child, ForeignKey<O, DataSourceRecord> key) {
|
||||
public <O extends Record> DataSourceTable(Table<O> child, ForeignKey<O, DataSourceRecord> key) {
|
||||
super(child, key, DATA_SOURCE);
|
||||
}
|
||||
|
||||
|
@ -153,29 +153,29 @@ public class DataSource extends TableImpl<DataSourceRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DataSource as(String alias) {
|
||||
return new DataSource(DSL.name(alias), this);
|
||||
public DataSourceTable as(String alias) {
|
||||
return new DataSourceTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSource as(Name alias) {
|
||||
return new DataSource(alias, this);
|
||||
public DataSourceTable as(Name alias) {
|
||||
return new DataSourceTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DataSource rename(String name) {
|
||||
return new DataSource(DSL.name(name), null);
|
||||
public DataSourceTable rename(String name) {
|
||||
return new DataSourceTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DataSource rename(Name name) {
|
||||
return new DataSource(name, null);
|
||||
public DataSourceTable rename(Name name) {
|
||||
return new DataSourceTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -32,14 +32,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DatabaseDocument extends TableImpl<DatabaseDocumentRecord> {
|
||||
public class DatabaseDocumentTable extends TableImpl<DatabaseDocumentRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.database_document</code>
|
||||
*/
|
||||
public static final DatabaseDocument DATABASE_DOCUMENT = new DatabaseDocument();
|
||||
public static final DatabaseDocumentTable DATABASE_DOCUMENT = new DatabaseDocumentTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -99,11 +99,11 @@ public class DatabaseDocument extends TableImpl<DatabaseDocumentRecord> {
|
|||
*/
|
||||
public final TableField<DatabaseDocumentRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DatabaseDocument(Name alias, Table<DatabaseDocumentRecord> aliased) {
|
||||
private DatabaseDocumentTable(Name alias, Table<DatabaseDocumentRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DatabaseDocument(Name alias, Table<DatabaseDocumentRecord> aliased, Field<?>[] parameters) {
|
||||
private DatabaseDocumentTable(Name alias, Table<DatabaseDocumentRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class DatabaseDocument extends TableImpl<DatabaseDocumentRecord> {
|
|||
* Create an aliased <code>databasir.database_document</code> table
|
||||
* reference
|
||||
*/
|
||||
public DatabaseDocument(String alias) {
|
||||
public DatabaseDocumentTable(String alias) {
|
||||
this(DSL.name(alias), DATABASE_DOCUMENT);
|
||||
}
|
||||
|
||||
|
@ -119,18 +119,18 @@ public class DatabaseDocument extends TableImpl<DatabaseDocumentRecord> {
|
|||
* Create an aliased <code>databasir.database_document</code> table
|
||||
* reference
|
||||
*/
|
||||
public DatabaseDocument(Name alias) {
|
||||
public DatabaseDocumentTable(Name alias) {
|
||||
this(alias, DATABASE_DOCUMENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.database_document</code> table reference
|
||||
*/
|
||||
public DatabaseDocument() {
|
||||
public DatabaseDocumentTable() {
|
||||
this(DSL.name("database_document"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DatabaseDocument(Table<O> child, ForeignKey<O, DatabaseDocumentRecord> key) {
|
||||
public <O extends Record> DatabaseDocumentTable(Table<O> child, ForeignKey<O, DatabaseDocumentRecord> key) {
|
||||
super(child, key, DATABASE_DOCUMENT);
|
||||
}
|
||||
|
||||
|
@ -155,29 +155,29 @@ public class DatabaseDocument extends TableImpl<DatabaseDocumentRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DatabaseDocument as(String alias) {
|
||||
return new DatabaseDocument(DSL.name(alias), this);
|
||||
public DatabaseDocumentTable as(String alias) {
|
||||
return new DatabaseDocumentTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseDocument as(Name alias) {
|
||||
return new DatabaseDocument(alias, this);
|
||||
public DatabaseDocumentTable as(Name alias) {
|
||||
return new DatabaseDocumentTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DatabaseDocument rename(String name) {
|
||||
return new DatabaseDocument(DSL.name(name), null);
|
||||
public DatabaseDocumentTable rename(String name) {
|
||||
return new DatabaseDocumentTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DatabaseDocument rename(Name name) {
|
||||
return new DatabaseDocument(name, null);
|
||||
public DatabaseDocumentTable rename(Name name) {
|
||||
return new DatabaseDocumentTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -32,14 +32,14 @@ import org.jooq.impl.TableImpl;
|
|||
* customer database types
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DatabaseType extends TableImpl<DatabaseTypeRecord> {
|
||||
public class DatabaseTypeTable extends TableImpl<DatabaseTypeRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.database_type</code>
|
||||
*/
|
||||
public static final DatabaseType DATABASE_TYPE = new DatabaseType();
|
||||
public static final DatabaseTypeTable DATABASE_TYPE = new DatabaseTypeTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -115,36 +115,36 @@ public class DatabaseType extends TableImpl<DatabaseTypeRecord> {
|
|||
*/
|
||||
public final TableField<DatabaseTypeRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DatabaseType(Name alias, Table<DatabaseTypeRecord> aliased) {
|
||||
private DatabaseTypeTable(Name alias, Table<DatabaseTypeRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DatabaseType(Name alias, Table<DatabaseTypeRecord> aliased, Field<?>[] parameters) {
|
||||
private DatabaseTypeTable(Name alias, Table<DatabaseTypeRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment("customer database types"), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.database_type</code> table reference
|
||||
*/
|
||||
public DatabaseType(String alias) {
|
||||
public DatabaseTypeTable(String alias) {
|
||||
this(DSL.name(alias), DATABASE_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.database_type</code> table reference
|
||||
*/
|
||||
public DatabaseType(Name alias) {
|
||||
public DatabaseTypeTable(Name alias) {
|
||||
this(alias, DATABASE_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.database_type</code> table reference
|
||||
*/
|
||||
public DatabaseType() {
|
||||
public DatabaseTypeTable() {
|
||||
this(DSL.name("database_type"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DatabaseType(Table<O> child, ForeignKey<O, DatabaseTypeRecord> key) {
|
||||
public <O extends Record> DatabaseTypeTable(Table<O> child, ForeignKey<O, DatabaseTypeRecord> key) {
|
||||
super(child, key, DATABASE_TYPE);
|
||||
}
|
||||
|
||||
|
@ -169,29 +169,29 @@ public class DatabaseType extends TableImpl<DatabaseTypeRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DatabaseType as(String alias) {
|
||||
return new DatabaseType(DSL.name(alias), this);
|
||||
public DatabaseTypeTable as(String alias) {
|
||||
return new DatabaseTypeTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseType as(Name alias) {
|
||||
return new DatabaseType(alias, this);
|
||||
public DatabaseTypeTable as(Name alias) {
|
||||
return new DatabaseTypeTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DatabaseType rename(String name) {
|
||||
return new DatabaseType(DSL.name(name), null);
|
||||
public DatabaseTypeTable rename(String name) {
|
||||
return new DatabaseTypeTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DatabaseType rename(Name name) {
|
||||
return new DatabaseType(name, null);
|
||||
public DatabaseTypeTable rename(Name name) {
|
||||
return new DatabaseTypeTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -32,14 +32,14 @@ import org.jooq.impl.TableImpl;
|
|||
* custom document description
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DocumentDescription extends TableImpl<DocumentDescriptionRecord> {
|
||||
public class DocumentDescriptionTable extends TableImpl<DocumentDescriptionRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.document_description</code>
|
||||
*/
|
||||
public static final DocumentDescription DOCUMENT_DESCRIPTION = new DocumentDescription();
|
||||
public static final DocumentDescriptionTable DOCUMENT_DESCRIPTION = new DocumentDescriptionTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -89,11 +89,11 @@ public class DocumentDescription extends TableImpl<DocumentDescriptionRecord> {
|
|||
*/
|
||||
public final TableField<DocumentDescriptionRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DocumentDescription(Name alias, Table<DocumentDescriptionRecord> aliased) {
|
||||
private DocumentDescriptionTable(Name alias, Table<DocumentDescriptionRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DocumentDescription(Name alias, Table<DocumentDescriptionRecord> aliased, Field<?>[] parameters) {
|
||||
private DocumentDescriptionTable(Name alias, Table<DocumentDescriptionRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment("custom document description"), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class DocumentDescription extends TableImpl<DocumentDescriptionRecord> {
|
|||
* Create an aliased <code>databasir.document_description</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentDescription(String alias) {
|
||||
public DocumentDescriptionTable(String alias) {
|
||||
this(DSL.name(alias), DOCUMENT_DESCRIPTION);
|
||||
}
|
||||
|
||||
|
@ -109,18 +109,18 @@ public class DocumentDescription extends TableImpl<DocumentDescriptionRecord> {
|
|||
* Create an aliased <code>databasir.document_description</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentDescription(Name alias) {
|
||||
public DocumentDescriptionTable(Name alias) {
|
||||
this(alias, DOCUMENT_DESCRIPTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.document_description</code> table reference
|
||||
*/
|
||||
public DocumentDescription() {
|
||||
public DocumentDescriptionTable() {
|
||||
this(DSL.name("document_description"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DocumentDescription(Table<O> child, ForeignKey<O, DocumentDescriptionRecord> key) {
|
||||
public <O extends Record> DocumentDescriptionTable(Table<O> child, ForeignKey<O, DocumentDescriptionRecord> key) {
|
||||
super(child, key, DOCUMENT_DESCRIPTION);
|
||||
}
|
||||
|
||||
|
@ -145,29 +145,29 @@ public class DocumentDescription extends TableImpl<DocumentDescriptionRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DocumentDescription as(String alias) {
|
||||
return new DocumentDescription(DSL.name(alias), this);
|
||||
public DocumentDescriptionTable as(String alias) {
|
||||
return new DocumentDescriptionTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentDescription as(Name alias) {
|
||||
return new DocumentDescription(alias, this);
|
||||
public DocumentDescriptionTable as(Name alias) {
|
||||
return new DocumentDescriptionTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentDescription rename(String name) {
|
||||
return new DocumentDescription(DSL.name(name), null);
|
||||
public DocumentDescriptionTable rename(String name) {
|
||||
return new DocumentDescriptionTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentDescription rename(Name name) {
|
||||
return new DocumentDescription(name, null);
|
||||
public DocumentDescriptionTable rename(Name name) {
|
||||
return new DocumentDescriptionTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -34,14 +34,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
||||
public class DocumentDiscussionTable 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();
|
||||
public static final DocumentDiscussionTable DOCUMENT_DISCUSSION = new DocumentDiscussionTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -86,11 +86,11 @@ public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
|||
*/
|
||||
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) {
|
||||
private DocumentDiscussionTable(Name alias, Table<DocumentDiscussionRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DocumentDiscussion(Name alias, Table<DocumentDiscussionRecord> aliased, Field<?>[] parameters) {
|
||||
private DocumentDiscussionTable(Name alias, Table<DocumentDiscussionRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
|||
* Create an aliased <code>databasir.document_discussion</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentDiscussion(String alias) {
|
||||
public DocumentDiscussionTable(String alias) {
|
||||
this(DSL.name(alias), DOCUMENT_DISCUSSION);
|
||||
}
|
||||
|
||||
|
@ -106,18 +106,18 @@ public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
|||
* Create an aliased <code>databasir.document_discussion</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentDiscussion(Name alias) {
|
||||
public DocumentDiscussionTable(Name alias) {
|
||||
this(alias, DOCUMENT_DISCUSSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.document_discussion</code> table reference
|
||||
*/
|
||||
public DocumentDiscussion() {
|
||||
public DocumentDiscussionTable() {
|
||||
this(DSL.name("document_discussion"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DocumentDiscussion(Table<O> child, ForeignKey<O, DocumentDiscussionRecord> key) {
|
||||
public <O extends Record> DocumentDiscussionTable(Table<O> child, ForeignKey<O, DocumentDiscussionRecord> key) {
|
||||
super(child, key, DOCUMENT_DISCUSSION);
|
||||
}
|
||||
|
||||
|
@ -142,29 +142,29 @@ public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DocumentDiscussion as(String alias) {
|
||||
return new DocumentDiscussion(DSL.name(alias), this);
|
||||
public DocumentDiscussionTable as(String alias) {
|
||||
return new DocumentDiscussionTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentDiscussion as(Name alias) {
|
||||
return new DocumentDiscussion(alias, this);
|
||||
public DocumentDiscussionTable as(Name alias) {
|
||||
return new DocumentDiscussionTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentDiscussion rename(String name) {
|
||||
return new DocumentDiscussion(DSL.name(name), null);
|
||||
public DocumentDiscussionTable rename(String name) {
|
||||
return new DocumentDiscussionTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentDiscussion rename(Name name) {
|
||||
return new DocumentDiscussion(name, null);
|
||||
public DocumentDiscussionTable rename(Name name) {
|
||||
return new DocumentDiscussionTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -8,28 +8,39 @@ import com.databasir.dao.Databasir;
|
|||
import com.databasir.dao.Indexes;
|
||||
import com.databasir.dao.Keys;
|
||||
import com.databasir.dao.tables.records.DocumentFullTextRecord;
|
||||
import org.jooq.*;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
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.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 DocumentFullText extends TableImpl<DocumentFullTextRecord> {
|
||||
public class DocumentFullTextTable extends TableImpl<DocumentFullTextRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.document_full_text</code>
|
||||
*/
|
||||
public static final DocumentFullText DOCUMENT_FULL_TEXT = new DocumentFullText();
|
||||
public static final DocumentFullTextTable DOCUMENT_FULL_TEXT = new DocumentFullTextTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -164,11 +175,11 @@ public class DocumentFullText extends TableImpl<DocumentFullTextRecord> {
|
|||
*/
|
||||
public final TableField<DocumentFullTextRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DocumentFullText(Name alias, Table<DocumentFullTextRecord> aliased) {
|
||||
private DocumentFullTextTable(Name alias, Table<DocumentFullTextRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DocumentFullText(Name alias, Table<DocumentFullTextRecord> aliased, Field<?>[] parameters) {
|
||||
private DocumentFullTextTable(Name alias, Table<DocumentFullTextRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -176,7 +187,7 @@ public class DocumentFullText extends TableImpl<DocumentFullTextRecord> {
|
|||
* Create an aliased <code>databasir.document_full_text</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentFullText(String alias) {
|
||||
public DocumentFullTextTable(String alias) {
|
||||
this(DSL.name(alias), DOCUMENT_FULL_TEXT);
|
||||
}
|
||||
|
||||
|
@ -184,18 +195,18 @@ public class DocumentFullText extends TableImpl<DocumentFullTextRecord> {
|
|||
* Create an aliased <code>databasir.document_full_text</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentFullText(Name alias) {
|
||||
public DocumentFullTextTable(Name alias) {
|
||||
this(alias, DOCUMENT_FULL_TEXT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.document_full_text</code> table reference
|
||||
*/
|
||||
public DocumentFullText() {
|
||||
public DocumentFullTextTable() {
|
||||
this(DSL.name("document_full_text"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DocumentFullText(Table<O> child, ForeignKey<O, DocumentFullTextRecord> key) {
|
||||
public <O extends Record> DocumentFullTextTable(Table<O> child, ForeignKey<O, DocumentFullTextRecord> key) {
|
||||
super(child, key, DOCUMENT_FULL_TEXT);
|
||||
}
|
||||
|
||||
|
@ -220,28 +231,28 @@ public class DocumentFullText extends TableImpl<DocumentFullTextRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DocumentFullText as(String alias) {
|
||||
return new DocumentFullText(DSL.name(alias), this);
|
||||
public DocumentFullTextTable as(String alias) {
|
||||
return new DocumentFullTextTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentFullText as(Name alias) {
|
||||
return new DocumentFullText(alias, this);
|
||||
public DocumentFullTextTable as(Name alias) {
|
||||
return new DocumentFullTextTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentFullText rename(String name) {
|
||||
return new DocumentFullText(DSL.name(name), null);
|
||||
public DocumentFullTextTable rename(String name) {
|
||||
return new DocumentFullTextTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentFullText rename(Name name) {
|
||||
return new DocumentFullText(name, null);
|
||||
public DocumentFullTextTable rename(Name name) {
|
||||
return new DocumentFullTextTable(name, null);
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ import org.jooq.impl.TableImpl;
|
|||
* template property
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class DocumentTemplateProperty extends TableImpl<DocumentTemplatePropertyRecord> {
|
||||
public class DocumentTemplatePropertyTable extends TableImpl<DocumentTemplatePropertyRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
* The reference instance of
|
||||
* <code>databasir.document_template_property</code>
|
||||
*/
|
||||
public static final DocumentTemplateProperty DOCUMENT_TEMPLATE_PROPERTY = new DocumentTemplateProperty();
|
||||
public static final DocumentTemplatePropertyTable DOCUMENT_TEMPLATE_PROPERTY = new DocumentTemplatePropertyTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -83,11 +83,11 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
*/
|
||||
public final TableField<DocumentTemplatePropertyRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private DocumentTemplateProperty(Name alias, Table<DocumentTemplatePropertyRecord> aliased) {
|
||||
private DocumentTemplatePropertyTable(Name alias, Table<DocumentTemplatePropertyRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private DocumentTemplateProperty(Name alias, Table<DocumentTemplatePropertyRecord> aliased, Field<?>[] parameters) {
|
||||
private DocumentTemplatePropertyTable(Name alias, Table<DocumentTemplatePropertyRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment("template property"), TableOptions.table());
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
* Create an aliased <code>databasir.document_template_property</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentTemplateProperty(String alias) {
|
||||
public DocumentTemplatePropertyTable(String alias) {
|
||||
this(DSL.name(alias), DOCUMENT_TEMPLATE_PROPERTY);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
* Create an aliased <code>databasir.document_template_property</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentTemplateProperty(Name alias) {
|
||||
public DocumentTemplatePropertyTable(Name alias) {
|
||||
this(alias, DOCUMENT_TEMPLATE_PROPERTY);
|
||||
}
|
||||
|
||||
|
@ -111,11 +111,11 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
* Create a <code>databasir.document_template_property</code> table
|
||||
* reference
|
||||
*/
|
||||
public DocumentTemplateProperty() {
|
||||
public DocumentTemplatePropertyTable() {
|
||||
this(DSL.name("document_template_property"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> DocumentTemplateProperty(Table<O> child, ForeignKey<O, DocumentTemplatePropertyRecord> key) {
|
||||
public <O extends Record> DocumentTemplatePropertyTable(Table<O> child, ForeignKey<O, DocumentTemplatePropertyRecord> key) {
|
||||
super(child, key, DOCUMENT_TEMPLATE_PROPERTY);
|
||||
}
|
||||
|
||||
|
@ -140,29 +140,29 @@ public class DocumentTemplateProperty extends TableImpl<DocumentTemplateProperty
|
|||
}
|
||||
|
||||
@Override
|
||||
public DocumentTemplateProperty as(String alias) {
|
||||
return new DocumentTemplateProperty(DSL.name(alias), this);
|
||||
public DocumentTemplatePropertyTable as(String alias) {
|
||||
return new DocumentTemplatePropertyTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentTemplateProperty as(Name alias) {
|
||||
return new DocumentTemplateProperty(alias, this);
|
||||
public DocumentTemplatePropertyTable as(Name alias) {
|
||||
return new DocumentTemplatePropertyTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentTemplateProperty rename(String name) {
|
||||
return new DocumentTemplateProperty(DSL.name(name), null);
|
||||
public DocumentTemplatePropertyTable rename(String name) {
|
||||
return new DocumentTemplatePropertyTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public DocumentTemplateProperty rename(Name name) {
|
||||
return new DocumentTemplateProperty(name, null);
|
||||
public DocumentTemplatePropertyTable rename(Name name) {
|
||||
return new DocumentTemplatePropertyTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -30,14 +30,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Group extends TableImpl<GroupRecord> {
|
||||
public class GroupTable extends TableImpl<GroupRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.group</code>
|
||||
*/
|
||||
public static final Group GROUP = new Group();
|
||||
public static final GroupTable GROUP = new GroupTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -77,36 +77,36 @@ public class Group extends TableImpl<GroupRecord> {
|
|||
*/
|
||||
public final TableField<GroupRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private Group(Name alias, Table<GroupRecord> aliased) {
|
||||
private GroupTable(Name alias, Table<GroupRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Group(Name alias, Table<GroupRecord> aliased, Field<?>[] parameters) {
|
||||
private GroupTable(Name alias, Table<GroupRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.group</code> table reference
|
||||
*/
|
||||
public Group(String alias) {
|
||||
public GroupTable(String alias) {
|
||||
this(DSL.name(alias), GROUP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.group</code> table reference
|
||||
*/
|
||||
public Group(Name alias) {
|
||||
public GroupTable(Name alias) {
|
||||
this(alias, GROUP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.group</code> table reference
|
||||
*/
|
||||
public Group() {
|
||||
public GroupTable() {
|
||||
this(DSL.name("group"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> Group(Table<O> child, ForeignKey<O, GroupRecord> key) {
|
||||
public <O extends Record> GroupTable(Table<O> child, ForeignKey<O, GroupRecord> key) {
|
||||
super(child, key, GROUP);
|
||||
}
|
||||
|
||||
|
@ -126,29 +126,29 @@ public class Group extends TableImpl<GroupRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Group as(String alias) {
|
||||
return new Group(DSL.name(alias), this);
|
||||
public GroupTable as(String alias) {
|
||||
return new GroupTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Group as(Name alias) {
|
||||
return new Group(alias, this);
|
||||
public GroupTable as(Name alias) {
|
||||
return new GroupTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Group rename(String name) {
|
||||
return new Group(DSL.name(name), null);
|
||||
public GroupTable rename(String name) {
|
||||
return new GroupTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Group rename(Name name) {
|
||||
return new Group(name, null);
|
||||
public GroupTable rename(Name name) {
|
||||
return new GroupTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -32,14 +32,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class Login extends TableImpl<LoginRecord> {
|
||||
public class LoginTable extends TableImpl<LoginRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.login</code>
|
||||
*/
|
||||
public static final Login LOGIN = new Login();
|
||||
public static final LoginTable LOGIN = new LoginTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -89,36 +89,36 @@ public class Login extends TableImpl<LoginRecord> {
|
|||
*/
|
||||
public final TableField<LoginRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private Login(Name alias, Table<LoginRecord> aliased) {
|
||||
private LoginTable(Name alias, Table<LoginRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Login(Name alias, Table<LoginRecord> aliased, Field<?>[] parameters) {
|
||||
private LoginTable(Name alias, Table<LoginRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.login</code> table reference
|
||||
*/
|
||||
public Login(String alias) {
|
||||
public LoginTable(String alias) {
|
||||
this(DSL.name(alias), LOGIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.login</code> table reference
|
||||
*/
|
||||
public Login(Name alias) {
|
||||
public LoginTable(Name alias) {
|
||||
this(alias, LOGIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.login</code> table reference
|
||||
*/
|
||||
public Login() {
|
||||
public LoginTable() {
|
||||
this(DSL.name("login"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> Login(Table<O> child, ForeignKey<O, LoginRecord> key) {
|
||||
public <O extends Record> LoginTable(Table<O> child, ForeignKey<O, LoginRecord> key) {
|
||||
super(child, key, LOGIN);
|
||||
}
|
||||
|
||||
|
@ -143,29 +143,29 @@ public class Login extends TableImpl<LoginRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Login as(String alias) {
|
||||
return new Login(DSL.name(alias), this);
|
||||
public LoginTable as(String alias) {
|
||||
return new LoginTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Login as(Name alias) {
|
||||
return new Login(alias, this);
|
||||
public LoginTable as(Name alias) {
|
||||
return new LoginTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Login rename(String name) {
|
||||
return new Login(DSL.name(name), null);
|
||||
public LoginTable rename(String name) {
|
||||
return new LoginTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Login rename(Name name) {
|
||||
return new Login(name, null);
|
||||
public LoginTable rename(Name name) {
|
||||
return new LoginTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -34,14 +34,14 @@ import org.jooq.impl.TableImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class MockDataRule extends TableImpl<MockDataRuleRecord> {
|
||||
public class MockDataRuleTable extends TableImpl<MockDataRuleRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.mock_data_rule</code>
|
||||
*/
|
||||
public static final MockDataRule MOCK_DATA_RULE = new MockDataRule();
|
||||
public static final MockDataRuleTable MOCK_DATA_RULE = new MockDataRuleTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -101,36 +101,36 @@ public class MockDataRule extends TableImpl<MockDataRuleRecord> {
|
|||
*/
|
||||
public final TableField<MockDataRuleRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private MockDataRule(Name alias, Table<MockDataRuleRecord> aliased) {
|
||||
private MockDataRuleTable(Name alias, Table<MockDataRuleRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private MockDataRule(Name alias, Table<MockDataRuleRecord> aliased, Field<?>[] parameters) {
|
||||
private MockDataRuleTable(Name alias, Table<MockDataRuleRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.mock_data_rule</code> table reference
|
||||
*/
|
||||
public MockDataRule(String alias) {
|
||||
public MockDataRuleTable(String alias) {
|
||||
this(DSL.name(alias), MOCK_DATA_RULE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.mock_data_rule</code> table reference
|
||||
*/
|
||||
public MockDataRule(Name alias) {
|
||||
public MockDataRuleTable(Name alias) {
|
||||
this(alias, MOCK_DATA_RULE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.mock_data_rule</code> table reference
|
||||
*/
|
||||
public MockDataRule() {
|
||||
public MockDataRuleTable() {
|
||||
this(DSL.name("mock_data_rule"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> MockDataRule(Table<O> child, ForeignKey<O, MockDataRuleRecord> key) {
|
||||
public <O extends Record> MockDataRuleTable(Table<O> child, ForeignKey<O, MockDataRuleRecord> key) {
|
||||
super(child, key, MOCK_DATA_RULE);
|
||||
}
|
||||
|
||||
|
@ -155,29 +155,29 @@ public class MockDataRule extends TableImpl<MockDataRuleRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public MockDataRule as(String alias) {
|
||||
return new MockDataRule(DSL.name(alias), this);
|
||||
public MockDataRuleTable as(String alias) {
|
||||
return new MockDataRuleTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MockDataRule as(Name alias) {
|
||||
return new MockDataRule(alias, this);
|
||||
public MockDataRuleTable as(Name alias) {
|
||||
return new MockDataRuleTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public MockDataRule rename(String name) {
|
||||
return new MockDataRule(DSL.name(name), null);
|
||||
public MockDataRuleTable rename(String name) {
|
||||
return new MockDataRuleTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public MockDataRule rename(Name name) {
|
||||
return new MockDataRule(name, null);
|
||||
public MockDataRuleTable rename(Name name) {
|
||||
return new MockDataRuleTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
|
@ -34,14 +34,14 @@ import org.jooq.impl.TableImpl;
|
|||
* oauth app info
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class OauthApp extends TableImpl<OauthAppRecord> {
|
||||
public class OauthAppTable extends TableImpl<OauthAppRecord> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>databasir.oauth_app</code>
|
||||
*/
|
||||
public static final OauthApp OAUTH_APP = new OauthApp();
|
||||
public static final OauthAppTable OAUTH_APP = new OauthAppTable();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
|
@ -111,36 +111,36 @@ public class OauthApp extends TableImpl<OauthAppRecord> {
|
|||
*/
|
||||
public final TableField<OauthAppRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, "");
|
||||
|
||||
private OauthApp(Name alias, Table<OauthAppRecord> aliased) {
|
||||
private OauthAppTable(Name alias, Table<OauthAppRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private OauthApp(Name alias, Table<OauthAppRecord> aliased, Field<?>[] parameters) {
|
||||
private OauthAppTable(Name alias, Table<OauthAppRecord> aliased, Field<?>[] parameters) {
|
||||
super(alias, null, aliased, parameters, DSL.comment("oauth app info"), TableOptions.table());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.oauth_app</code> table reference
|
||||
*/
|
||||
public OauthApp(String alias) {
|
||||
public OauthAppTable(String alias) {
|
||||
this(DSL.name(alias), OAUTH_APP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>databasir.oauth_app</code> table reference
|
||||
*/
|
||||
public OauthApp(Name alias) {
|
||||
public OauthAppTable(Name alias) {
|
||||
this(alias, OAUTH_APP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>databasir.oauth_app</code> table reference
|
||||
*/
|
||||
public OauthApp() {
|
||||
public OauthAppTable() {
|
||||
this(DSL.name("oauth_app"), null);
|
||||
}
|
||||
|
||||
public <O extends Record> OauthApp(Table<O> child, ForeignKey<O, OauthAppRecord> key) {
|
||||
public <O extends Record> OauthAppTable(Table<O> child, ForeignKey<O, OauthAppRecord> key) {
|
||||
super(child, key, OAUTH_APP);
|
||||
}
|
||||
|
||||
|
@ -165,29 +165,29 @@ public class OauthApp extends TableImpl<OauthAppRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public OauthApp as(String alias) {
|
||||
return new OauthApp(DSL.name(alias), this);
|
||||
public OauthAppTable as(String alias) {
|
||||
return new OauthAppTable(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OauthApp as(Name alias) {
|
||||
return new OauthApp(alias, this);
|
||||
public OauthAppTable as(Name alias) {
|
||||
return new OauthAppTable(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public OauthApp rename(String name) {
|
||||
return new OauthApp(DSL.name(name), null);
|
||||
public OauthAppTable rename(String name) {
|
||||
return new OauthAppTable(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public OauthApp rename(Name name) {
|
||||
return new OauthApp(name, null);
|
||||
public OauthAppTable rename(Name name) {
|
||||
return new OauthAppTable(name, null);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue