подправил кеширование отображаемых данных ( чтобы не распаковывать каждый раз список имен групп и прочее)
This commit is contained in:
17
.idea/workspace.xml
generated
17
.idea/workspace.xml
generated
@@ -7,7 +7,24 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/ConfigurationCache.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCache.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/Common/UI/VisualCache/VisualCaches.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Database/DataSet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Database/DataSet.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMConfiguration/DVMConfigurationDBTable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteConfiguration.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteGroup.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteGroup.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforConfiguration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforConfiguration.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforConfigurationCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteSapforConfigurationCommand.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowCurrentDVMConfigurationTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowCurrentDVMConfigurationTests.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedDVMConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSelectedDVMConfigurations.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/DeleteServerObjects.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObjects.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/DeleteTestingPackages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/DeleteTestingPackages.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/DeleteServerObject.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/EditServerObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/Server/EditServerObject.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
//-
|
||||
public static LinkedHashMap<Class, Object> selections = new LinkedHashMap<>();
|
||||
//-
|
||||
public LinkedHashMap<Class, Object> selections = new LinkedHashMap<>();
|
||||
//---
|
||||
public String Name;
|
||||
public Class<K> k; //класс первичного ключа.
|
||||
public Class<D> d; //класс объектов.
|
||||
|
||||
57
src/Common/UI/VisualCache/ConfigurationCache.java
Normal file
57
src/Common/UI/VisualCache/ConfigurationCache.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package Common.UI.VisualCache;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Configuration.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Group.Json.GroupJson;
|
||||
import TestingSystem.Common.Group.Json.GroupsJson;
|
||||
import TestingSystem.Common.Test.Json.TestJson;
|
||||
import TestingSystem.Common.Test.Json.TestsJson;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ConfigurationCache extends VisualCache{
|
||||
public GroupsJson groupsJson = null;
|
||||
public Vector<String> groupsDescriptions = null;
|
||||
public TestsJson testsJson = null;
|
||||
//--
|
||||
public ConfigurationCache(Configuration configuration) {
|
||||
if (configuration.packedGroupsJson.isEmpty())
|
||||
groupsJson = new GroupsJson(); //просто пустой
|
||||
else
|
||||
groupsJson = Utils.gson.fromJson(configuration.packedGroupsJson, GroupsJson.class);
|
||||
//--
|
||||
if (testsJson == null) {
|
||||
if (configuration.packedTestsJson.isEmpty())
|
||||
testsJson = new TestsJson(); //просто пустой
|
||||
else
|
||||
testsJson = Utils.gson.fromJson(configuration.packedTestsJson, TestsJson.class);
|
||||
}
|
||||
//-
|
||||
groupsDescriptions = new Vector<>();
|
||||
for (GroupJson groupJson : groupsJson.array)
|
||||
groupsDescriptions.add(groupJson.description);
|
||||
}
|
||||
public int getTestsCount() {
|
||||
return testsJson.array.size();
|
||||
}
|
||||
public Vector<String> getGroupsDescriptions() {
|
||||
return groupsDescriptions;
|
||||
}
|
||||
public Vector<Group> getGroups(){
|
||||
Vector<Group> groups = new Vector<>();
|
||||
for (GroupJson groupJson : groupsJson.array){
|
||||
if (Global.testingServer.db.groups.containsKey(groupJson.id))
|
||||
groups.add(Global.testingServer.db.groups.get(groupJson.id));
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
public Vector<Test> getTests(){
|
||||
Vector<Test> tests = new Vector<>();
|
||||
for (TestJson testJson : testsJson.array){
|
||||
if (Global.testingServer.db.tests.containsKey(testJson.id))
|
||||
tests.add(Global.testingServer.db.tests.get(testJson.id));
|
||||
}
|
||||
return tests;
|
||||
}
|
||||
}
|
||||
3
src/Common/UI/VisualCache/VisualCache.java
Normal file
3
src/Common/UI/VisualCache/VisualCache.java
Normal file
@@ -0,0 +1,3 @@
|
||||
package Common.UI.VisualCache;
|
||||
public class VisualCache {
|
||||
}
|
||||
46
src/Common/UI/VisualCache/VisualCaches.java
Normal file
46
src/Common/UI/VisualCache/VisualCaches.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package Common.UI.VisualCache;
|
||||
import Common.Database.DBObject;
|
||||
import TestingSystem.Common.Configuration.Configuration;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public class VisualCaches {
|
||||
static LinkedHashMap<Class, LinkedHashMap<Object, VisualCache>> allData = new LinkedHashMap<>();
|
||||
static LinkedHashMap<Object, VisualCache> getDataForClass(Class class_) {
|
||||
LinkedHashMap<Object, VisualCache> data;
|
||||
if (allData.containsKey(class_)) {
|
||||
data = allData.get(class_);
|
||||
} else {
|
||||
data = new LinkedHashMap<>();
|
||||
allData.put(class_, data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
//чтобы не трогать сами объекты и не сбить сериализацию
|
||||
static VisualCache createCache(Object object) {
|
||||
if (object instanceof Configuration)
|
||||
return new ConfigurationCache((Configuration) object);
|
||||
return new VisualCache();
|
||||
}
|
||||
public static VisualCache GetCache(DBObject object) {
|
||||
// System.out.println("get visual cache for " + object.getPK());
|
||||
VisualCache res = null;
|
||||
LinkedHashMap<Object, VisualCache> data = getDataForClass(object.getClass());
|
||||
if (!data.containsKey(object.getPK())) {
|
||||
// System.out.println("cache not found, creating...");
|
||||
data.put(object.getPK(), res = createCache(object));
|
||||
} else {
|
||||
// System.out.println("cache found");
|
||||
res = data.get(object.getPK());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void DeleteCahce(DBObject object){
|
||||
DeleteCahce(object.getClass(), object.getPK());
|
||||
}
|
||||
public static void DeleteCahce(Class class_, Object pk){
|
||||
LinkedHashMap<Object, VisualCache> data = getDataForClass(class_);
|
||||
if (data.containsKey(pk))
|
||||
data.remove(pk);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,13 @@
|
||||
package TestingSystem.Common.Configuration;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.riDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Group.Json.GroupJson;
|
||||
import TestingSystem.Common.Group.Json.GroupsJson;
|
||||
import TestingSystem.Common.Test.Json.TestJson;
|
||||
import TestingSystem.Common.Test.Json.TestsJson;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class Configuration extends riDBObject {
|
||||
//конфигурация = данные для пакета.
|
||||
@@ -34,14 +30,13 @@ public class Configuration extends riDBObject {
|
||||
public String packedGroupsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedTestsJson = "";
|
||||
//----
|
||||
//---данные для отображения. кешировать их где-то еще? проблема что отправляются на сервер почем зря.
|
||||
@Description("IGNORE")
|
||||
public GroupsJson groupsJson = null;
|
||||
@Description("IGNORE")
|
||||
public Vector<String> groupsDescriptions = null;
|
||||
@Description("IGNORE")
|
||||
public TestsJson testsJson = null;
|
||||
//--
|
||||
public void saveGroupsAsJson(Vector<Group> groups) {
|
||||
packedGroupsJson = Utils.jsonToPrettyFormat(Utils.gson.toJson(new GroupsJson(groups)));
|
||||
}
|
||||
public void saveTestsAsJson(Vector<Test> tests) {
|
||||
packedTestsJson = Utils.jsonToPrettyFormat(Utils.gson.toJson(new TestsJson(tests)));
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
@@ -55,60 +50,4 @@ public class Configuration extends riDBObject {
|
||||
packedTestsJson = c.packedTestsJson;
|
||||
}
|
||||
//-
|
||||
public void saveGroupsAsJson(Vector<Group> groups) {
|
||||
packedGroupsJson = Utils.jsonToPrettyFormat(Utils.gson.toJson(new GroupsJson(groups)));
|
||||
}
|
||||
void unpackGroupsAsJson() {
|
||||
if (groupsJson == null) {
|
||||
if (packedGroupsJson.isEmpty())
|
||||
groupsJson = new GroupsJson(); //просто пустой
|
||||
else
|
||||
groupsJson = Utils.gson.fromJson(packedGroupsJson, GroupsJson.class);
|
||||
}
|
||||
}
|
||||
public Vector<String> getGroupsDescriptions() {
|
||||
if (groupsDescriptions==null) {
|
||||
unpackGroupsAsJson();
|
||||
groupsDescriptions = new Vector<>();
|
||||
for (GroupJson groupJson : groupsJson.array)
|
||||
groupsDescriptions.add(groupJson.description);
|
||||
}
|
||||
return groupsDescriptions;
|
||||
}
|
||||
public Vector<Group> getGroups() {
|
||||
//здесь обращение реже так что буферизовать список групп не надо, тем более может меняться.
|
||||
unpackGroupsAsJson();
|
||||
Vector<Group> res = new Vector<>();
|
||||
for (GroupJson groupJson: groupsJson.array){
|
||||
if (Global.testingServer.db.groups.containsKey(groupJson.id))
|
||||
res.add(Global.testingServer.db.groups.get(groupJson.id));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//--------------------------------------------------------------------->>>
|
||||
public void saveTestsAsJson(Vector<Test> tests) {
|
||||
packedTestsJson = Utils.jsonToPrettyFormat(Utils.gson.toJson(new TestsJson(tests)));
|
||||
}
|
||||
void unpackTestsAsJson() {
|
||||
if (testsJson == null) {
|
||||
if (packedTestsJson.isEmpty())
|
||||
testsJson = new TestsJson(); //просто пустой
|
||||
else
|
||||
testsJson = Utils.gson.fromJson(packedTestsJson, TestsJson.class);
|
||||
}
|
||||
}
|
||||
public int getTestsCount(){
|
||||
unpackTestsAsJson();
|
||||
return testsJson.array.size();
|
||||
}
|
||||
public Vector<Test> getTests() {
|
||||
//здесь обращение реже так что буферизовать список групп не надо, тем более может меняться.
|
||||
unpackTestsAsJson();
|
||||
Vector<Test> res = new Vector<>();
|
||||
for (TestJson testJson: testsJson.array){
|
||||
if (Global.testingServer.db.tests.containsKey(testJson.id))
|
||||
res.add(Global.testingServer.db.tests.get(testJson.id));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,12 @@ package TestingSystem.DVM.DVMConfiguration;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Tables.TableRenderers;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Common.UI.VisualiserStringList;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Utils;
|
||||
@@ -62,23 +66,24 @@ public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(DVMConfiguration object, int columnIndex) {
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(object);
|
||||
switch (columnIndex) {
|
||||
case 2:
|
||||
return object.description;
|
||||
case 3:
|
||||
return object.sender_name;
|
||||
//---
|
||||
case 4:
|
||||
return object.printAuto();
|
||||
case 5:
|
||||
return object.getGroupsDescriptions();
|
||||
return cache.getGroupsDescriptions();
|
||||
case 6:
|
||||
return object.getTestsCount();
|
||||
//---
|
||||
return cache.getTestsCount();
|
||||
//todo упростить. и флаги и окружение будут просто одной строкой. мульти не актуально.
|
||||
case 7:
|
||||
return Utils.unpackStrings(object.flags, true);
|
||||
case 8:
|
||||
return Utils.unpackStrings(object.environments, true);
|
||||
//------------------------------------------------------------------------------------
|
||||
case 9:
|
||||
return object.c_maxtime;
|
||||
case 10:
|
||||
|
||||
@@ -2,7 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
public class DeleteConfiguration extends DeleteServerObjects<TestingServer, DVMConfiguration> {
|
||||
public DeleteConfiguration() {
|
||||
super(Global.testingServer, DVMConfiguration.class);
|
||||
|
||||
@@ -2,7 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
public class DeleteGroup extends DeleteServerObjects<TestingServer, Group> {
|
||||
public DeleteGroup() {
|
||||
super(Global.testingServer, Group.class);
|
||||
|
||||
@@ -2,7 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
public class DeleteSapforConfiguration extends DeleteServerObjects<TestingServer, SapforConfiguration> {
|
||||
public DeleteSapforConfiguration() {
|
||||
super(Global.testingServer, SapforConfiguration.class);
|
||||
|
||||
@@ -2,7 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import TestingSystem.SAPFOR.SapforConfigurationCommand.SapforConfigurationCommand;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
public class DeleteSapforConfigurationCommand extends DeleteServerObjects<TestingServer, SapforConfigurationCommand> {
|
||||
public DeleteSapforConfigurationCommand() {
|
||||
super(Global.testingServer, SapforConfigurationCommand.class);
|
||||
|
||||
@@ -2,7 +2,7 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Global;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.DeleteServerObjects;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
public class DeleteTest extends DeleteServerObjects<TestingServer, Test> {
|
||||
public DeleteTest() {
|
||||
super(Global.testingServer, Test.class);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
@@ -32,8 +34,9 @@ public class ShowCurrentDVMConfigurationTests extends Pass_2021<DVMConfiguration
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
System.out.println("package="+target.id);
|
||||
Vector<Group> groups = target.getGroups();
|
||||
Vector<Test> tests = target.getTests();
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(target);
|
||||
Vector<Group> groups = cache.getGroups();
|
||||
Vector<Test> tests = cache.getTests();
|
||||
//-----
|
||||
//--
|
||||
for (Group group: groups)
|
||||
|
||||
@@ -2,6 +2,8 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.VisualCache.ConfigurationCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Machine.MachineType;
|
||||
@@ -141,8 +143,9 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
|
||||
);
|
||||
//----
|
||||
for (DVMConfiguration configuration: configurations) {
|
||||
groups = configuration.getGroups();
|
||||
tests = configuration.getTests();
|
||||
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(configuration);
|
||||
groups = cache.getGroups();
|
||||
tests = cache.getTests();
|
||||
//-
|
||||
for (Group group: groups){
|
||||
Vector<Test> groupTests = new Vector<>();
|
||||
|
||||
@@ -4,10 +4,11 @@ import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.Server.DeleteServerObjects;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Vector;
|
||||
public abstract class DeleteTestingPackages<P extends TestingPackage> extends DeleteServerObjects<TestingServer, P>{
|
||||
public abstract class DeleteTestingPackages<P extends TestingPackage> extends DeleteServerObjects<TestingServer, P> {
|
||||
boolean delete_draft;
|
||||
public DeleteTestingPackages(Class<P> p) {
|
||||
super(Global.testingServer, p);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Database.DBObject;
|
||||
import Common.UI.VisualCache.VisualCache;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Repository.RepositoryServer;
|
||||
public class DeleteServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
@Override
|
||||
@@ -11,6 +13,11 @@ public class DeleteServerObject<S extends RepositoryServer, D extends DBObject>
|
||||
target = (D) getDb().tables.get(d).getCurrent();
|
||||
return getDb().tables.get(d).CheckCurrent(Log) && getDb().tables.get(d).ShowDeleteObjectDialog(target);
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
VisualCaches.DeleteCahce(target);
|
||||
}
|
||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package Visual_DVM_2021.Passes;
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.DBTable;
|
||||
import Common.Database.Database;
|
||||
import Common.UI.UI;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Repository.RepositoryServer;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -48,6 +49,13 @@ public class DeleteServerObjects <S extends RepositoryServer, D extends DBObject
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
for (Object key: target){
|
||||
VisualCaches.DeleteCahce(d, key);
|
||||
}
|
||||
}
|
||||
//Очищаем все связанные таблицы, чтобы не допустить перерисовки во время удаления объекта.
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
@@ -1,5 +1,6 @@
|
||||
package Visual_DVM_2021.Passes.Server;
|
||||
import Common.Database.DBObject;
|
||||
import Common.UI.VisualCache.VisualCaches;
|
||||
import Repository.RepositoryServer;
|
||||
public class EditServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
|
||||
//--
|
||||
@@ -13,6 +14,12 @@ public class EditServerObject<S extends RepositoryServer, D extends DBObject> ex
|
||||
target = (D) getDb().tables.get(d).getCurrent();
|
||||
return getDb().tables.get(d).CheckCurrent(Log) && getDb().tables.get(d).ShowEditObjectDialog(target);
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
super.performPreparation();
|
||||
//очистить кэш.
|
||||
VisualCaches.DeleteCahce(target);
|
||||
}
|
||||
//--
|
||||
public EditServerObject(S server_in, Class<D> d_in) {
|
||||
super(server_in, d_in);
|
||||
|
||||
Reference in New Issue
Block a user