|
|
@ -158,26 +158,26 @@ public class DesignerStartup extends Activator { |
|
|
|
|
|
|
|
|
|
|
|
private void registerDaoSelector() { |
|
|
|
private void registerDaoSelector() { |
|
|
|
// 注入设计器db cache 是否可用
|
|
|
|
// 注入设计器db cache 是否可用
|
|
|
|
DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo(); |
|
|
|
DaoSelectorFactory.registerDaoSelector(() -> false); |
|
|
|
if (info.getType() == DesignerWorkspaceType.Remote) { |
|
|
|
// DesignerWorkspaceInfo info = WorkspaceUtils.getWorkspaceInfo();
|
|
|
|
DaoSelectorFactory.registerDaoSelector(() -> false); |
|
|
|
// if (info.getType() == DesignerWorkspaceType.Remote) {
|
|
|
|
} else { |
|
|
|
// } else {
|
|
|
|
String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath(); |
|
|
|
// String webInfPath = WorkspaceUtils.getWorkspaceInfo().getPath();
|
|
|
|
String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY, |
|
|
|
// String dbConfigPath = StableUtils.pathJoin(webInfPath, ProjectConstants.CONFIG_DIRECTORY,
|
|
|
|
EncryptionConstants.PROPERTY_NAME); |
|
|
|
// EncryptionConstants.PROPERTY_NAME);
|
|
|
|
String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP); |
|
|
|
// String entityPath = generatePath(webInfPath, PropertiesConstants.ENTITY_PROP);
|
|
|
|
String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP); |
|
|
|
// String xmlEntityPath = generatePath(webInfPath, PropertiesConstants.XML_ENTITY_PROP);
|
|
|
|
String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP); |
|
|
|
// String classNamePath = generatePath(webInfPath, PropertiesConstants.CLASS_NAME_PROP);
|
|
|
|
// 校验 平台迁移文件/缓存文件
|
|
|
|
// // 校验 平台迁移文件/缓存文件
|
|
|
|
boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists(); |
|
|
|
// boolean existPropCache = new File(entityPath).exists() && new File(xmlEntityPath).exists() && new File(classNamePath).exists();
|
|
|
|
DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable() |
|
|
|
// DaoSelectorFactory.registerDaoSelector(() -> DesignerEnvManager.getEnvManager().isPropertiesUsable()
|
|
|
|
&& OptimizeUtil.isOpen() |
|
|
|
// && OptimizeUtil.isOpen()
|
|
|
|
&& existPropCache |
|
|
|
// && existPropCache
|
|
|
|
// demo启动时 前后目录可能会不一致 造成读取缓存失败
|
|
|
|
// // demo启动时 前后目录可能会不一致 造成读取缓存失败
|
|
|
|
&& !startupArgsValue.getValue().isDemo() |
|
|
|
// && !startupArgsValue.getValue().isDemo()
|
|
|
|
&& !new File(dbConfigPath).exists()); |
|
|
|
// && !new File(dbConfigPath).exists());
|
|
|
|
|
|
|
|
//
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String generatePath(String webInfPath, String name) { |
|
|
|
private String generatePath(String webInfPath, String name) { |
|
|
|