no message

This commit is contained in:
2024-10-07 14:22:52 +03:00
parent 6b1576461d
commit 61fc37b574
173 changed files with 960 additions and 1526 deletions

View File

@@ -1,8 +1,8 @@
package Common.Database;
import Common_old.Constants;
import Common.CommonConstants;
import Common.Utils.CommonUtils;
import Common.Database.Tables.DBTable;
import _VisualDVM.Global;
import Common_old.Utils.Utils;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DataSet;
import Common.Database.Objects.iDBObject;
@@ -85,7 +85,7 @@ public abstract class Database {
public DBObject InsertS(DBObject object) throws Exception {
DBTable table = tables.get(object.getClass());
if (!(object instanceof iDBObject) && table.Data.containsKey(object.getPK()))
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " уже содержит объект с ключом " + Utils.Brackets(object.getPK().toString()));
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " уже содержит объект с ключом " + CommonUtils.Brackets(object.getPK().toString()));
insert(table, object);
table.Data.put(object.getPK(), object);
return object;
@@ -112,7 +112,7 @@ public abstract class Database {
table.Data.remove(o.getPK());
return o;
} else
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " не содержит объект с ключом " + Utils.Brackets(to_delete.getPK().toString()));
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " не содержит объект с ключом " + CommonUtils.Brackets(to_delete.getPK().toString()));
}
public DBObject DeleteByPK(Class object_class, Object key) throws Exception {
DBTable table = tables.get(object_class);
@@ -122,7 +122,7 @@ public abstract class Database {
table.Data.remove(key);
return o;
} else
throw new RepositoryRefuseException("Таблица " + Utils.Brackets(table.Name) + " не содержит объект с ключом " + Utils.Brackets(key.toString()));
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " не содержит объект с ключом " + CommonUtils.Brackets(key.toString()));
}
// не работает с автоинкрементом.
public DBObject getObjectCopyByPK(Class table_class, Object pk) throws Exception {
@@ -233,7 +233,7 @@ public abstract class Database {
(O) (tables.get(class_in).Data.get(pk)) : null;
}
public <O extends iDBObject> O getById(Class<O> class_in, int pk) {
return getByPK(class_in, pk, Constants.Nan);
return getByPK(class_in, pk, CommonConstants.Nan);
}
public <G, O extends DBObject, F extends DBObject> LinkedHashMap<G, F> getByFKAndGroupBy(O owner, Class<F> fk_class, String group_field, Class<G> group_class) {
LinkedHashMap<G, F> res = new LinkedHashMap<>();