no message
This commit is contained in:
@@ -3,8 +3,8 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DBTableColumn;
|
||||
import Common.Database.Database;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Passes.PassException;
|
||||
import javafx.util.Pair;
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.sql.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import static Common.Utils.CommonUtils.requireNonNullElse;
|
||||
import static Common.Utils.Utils_.requireNonNullElse;
|
||||
public abstract class SQLiteDatabase extends Database {
|
||||
protected Connection conn = null;
|
||||
protected Statement statement = null;
|
||||
@@ -36,7 +36,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
ex.printStackTrace();
|
||||
conn = null;
|
||||
System.gc();
|
||||
CommonUtils.sleep(2000);
|
||||
Utils_.sleep(2000);
|
||||
}
|
||||
}
|
||||
if (conn == null)
|
||||
@@ -116,7 +116,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
Vector<String> columns_names = new Vector<>();
|
||||
for (DBTableColumn column : table.columns.values())
|
||||
columns_names.add(column.toString());
|
||||
cmd += CommonUtils.RBrackets(String.join(",", columns_names));
|
||||
cmd += Utils_.RBrackets(String.join(",", columns_names));
|
||||
statement.execute(cmd);
|
||||
}
|
||||
}
|
||||
@@ -135,8 +135,8 @@ public abstract class SQLiteDatabase extends Database {
|
||||
}
|
||||
insertStatements.put(table.d, conn.prepareStatement(
|
||||
"INSERT OR REPLACE INTO " + table.QName() + " " +
|
||||
CommonUtils.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
||||
CommonUtils.RBrackets(String.join(",", column_values))));
|
||||
Utils_.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
||||
Utils_.RBrackets(String.join(",", column_values))));
|
||||
//------------------------------------------------------------------------------->>
|
||||
Vector<String> new_values = new Vector();
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
@@ -194,7 +194,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
if (field_value != null) {
|
||||
table.d.getField(column.Name).set(o, field_value);
|
||||
} else
|
||||
throw new PassException("Ошибка при загрузке поля " + CommonUtils.Brackets(column.Name) + " класса " + CommonUtils.Brackets(table.d.getSimpleName()));
|
||||
throw new PassException("Ошибка при загрузке поля " + Utils_.Brackets(column.Name) + " класса " + Utils_.Brackets(table.d.getSimpleName()));
|
||||
}
|
||||
return new Pair<>((K) o.getPK(), o);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
protected void insert(DBTable table, DBObject o) throws Exception {
|
||||
PreparedStatement ps = insertStatements.get(table.d);
|
||||
if (ps == null)
|
||||
CommonUI.Info("INSERT NULL");
|
||||
UI_.Info("INSERT NULL");
|
||||
int i = 1;
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
if (!column.AutoIncrement) {
|
||||
@@ -234,7 +234,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
protected void update(DBTable table, DBObject o) throws Exception {
|
||||
PreparedStatement ps = updateStatements.get(table.d);
|
||||
if (ps == null)
|
||||
CommonUI.Info("UPDATE NULL");
|
||||
UI_.Info("UPDATE NULL");
|
||||
int i = 1;
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
if (!column.AutoIncrement) {
|
||||
|
||||
Reference in New Issue
Block a user