рефакторинг. вынес в обобщенную часть бд, но еще не все
This commit is contained in:
@@ -3,7 +3,6 @@ import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.Utils.Utils;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.User.User;
|
||||
@@ -45,7 +44,7 @@ public abstract class Task extends iDBObject {
|
||||
EndDate = 0;
|
||||
Time = 0;
|
||||
state = TaskState.Inactive;
|
||||
Global.db.Update(this);
|
||||
CommonUtils.db.Update(this);
|
||||
}
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="локальные файлы">
|
||||
@@ -67,10 +66,10 @@ public abstract class Task extends iDBObject {
|
||||
return new Date(EndDate);
|
||||
}
|
||||
public Machine getMachine() {
|
||||
return Global.db.getById(Machine.class, machine_id);
|
||||
return CommonUtils.db.getById(Machine.class, machine_id);
|
||||
}
|
||||
public User getUser() {
|
||||
return Global.db.getById(User.class, user_id);
|
||||
return CommonUtils.db.getById(User.class, user_id);
|
||||
}
|
||||
protected String getTextResult(File file) {
|
||||
return (file.exists()) ? Utils.ReadAllText(file) : "файл не найден. Задача еще не выполнялась или была завершена некорректно";
|
||||
@@ -93,7 +92,7 @@ public abstract class Task extends iDBObject {
|
||||
if (state != state_in) {
|
||||
state = state_in;
|
||||
try {
|
||||
Global.db.Update(this);
|
||||
CommonUtils.db.Update(this);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user