рефакторинг адресатов баг репортов
This commit is contained in:
@@ -1,21 +1,19 @@
|
||||
package _VisualDVM.ComponentsServer;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingJson;
|
||||
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipient;
|
||||
import _VisualDVM.ComponentsServer.BugReportRecipient.BugReportRecipientsDBTable;
|
||||
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSettingsDBTable;
|
||||
import _VisualDVM.ComponentsServer.Recipient.RecipientsDataSet;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.SapforData.SapforProperties;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Vector;
|
||||
public class BugReportsDatabase extends SQLiteDatabase {
|
||||
public BugReportsDBTable bugReports;
|
||||
public BugReportSettingsDBTable bugReportSettings;
|
||||
public BugReportRecipientsDBTable bugReportRecipients;
|
||||
public RecipientsDataSet recipients = new RecipientsDataSet();
|
||||
public BugReportsDatabase() {
|
||||
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
|
||||
@@ -24,6 +22,7 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
protected void initAllTables() throws Exception {
|
||||
addTable(bugReports = new BugReportsDBTable());
|
||||
addTable(bugReportSettings = new BugReportSettingsDBTable());
|
||||
addTable(bugReportRecipients = new BugReportRecipientsDBTable());
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
@@ -50,7 +49,16 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
recipients.ShowUI(); //todo временно.
|
||||
super.ResetUI();
|
||||
}
|
||||
public void saveBugreportRecipients(BugReport bugReport) throws Exception {
|
||||
if (bugReport.recipients != null) {
|
||||
for (BugReportRecipient recipient : bugReport.recipients) {
|
||||
recipient.bugreport_id = bugReport.id;
|
||||
Insert(recipient);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void Patch() throws Exception {
|
||||
/*
|
||||
Vector<BugReportSetting> settings = new Vector<>();
|
||||
//--
|
||||
for (BugReport bugReport : bugReports.Data.values()) {
|
||||
@@ -79,5 +87,23 @@ public class BugReportsDatabase extends SQLiteDatabase {
|
||||
for (BugReportSetting bugReportSetting : settings)
|
||||
Insert(bugReportSetting);
|
||||
Commit();
|
||||
*/
|
||||
//---
|
||||
/*
|
||||
Vector<BugReportRecipient> recipients = new Vector<>();
|
||||
for (BugReport bugReport: bugReports.Data.values()){
|
||||
RecipientsJson recipientsJson = Utils_.gson.fromJson(bugReport.packedRecipientsJson, RecipientsJson.class);
|
||||
for (RecipientJson recipientJson: recipientsJson.array){
|
||||
recipients.add(new BugReportRecipient(bugReport, recipientJson.address));
|
||||
}
|
||||
}
|
||||
|
||||
//-
|
||||
BeginTransaction();
|
||||
for (BugReportRecipient recipient: recipients){
|
||||
Insert(recipient);
|
||||
}
|
||||
Commit();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user