рефакторинг. прописал стандартную проверку существования объекта в бд сервера
This commit is contained in:
@@ -377,6 +377,17 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
public Database getDb() {
|
||||
return db;
|
||||
}
|
||||
public void checkExistense(Database database, Object pk, Class d_class) throws Exception {
|
||||
if (!database.getTable(d_class).containsKey(pk))
|
||||
throw new RepositoryRefuseException(
|
||||
database.getTable(d_class).getSingleDescription()+
|
||||
" с ключом "+
|
||||
Utils_.Brackets(pk.toString())+
|
||||
" не существует");
|
||||
}
|
||||
public void checkExistense(Object pk, Class d_class) throws Exception {
|
||||
checkExistense(db, pk, d_class);
|
||||
}
|
||||
//-------------
|
||||
void publishObject_(Database database, DBObject dbObject) throws Exception {
|
||||
beforePublishAction(dbObject);
|
||||
|
||||
Reference in New Issue
Block a user