= DB.STATUSES.db;
try{
db.beginTransaction();
SQLiteStatement deleteStatement = db.compileStatement(SqlStatementPrepareHelper.getDeleteQueryForStatement(DB.STATUSES.getTableName(), accID));
deleteStatement.clearBindings();
deleteStatement.executeUpdateDelete();
SQLiteStatement statement = db.compileStatement(SqlStatementPrepareHelper.getQueryForStatement(DB.STATUSES.getTableName(), DB.STATUSES.tableColumns()));
for (Status item : getItems()) {
statement.clearBindings();
SqlStatementPrepareHelper.bindStringOrNull(statement, 1, item.accID);
SqlStatementPrepareHelper.bindStringOrNull(statement, 2, item.getStatusId());
SqlStatementPrepareHelper.bindStringOrNull(statement, 3, item.getName());
SqlStatementPrepareHelper.bindStringOrNull(statement, 4, item.getVisible());
SqlStatementPrepareHelper.bindStringOrNull(statement, 5, item.isDefault());
SqlStatementPrepareHelper.bindStringOrNull(statement, 6, item.isClosed());
SqlStatementPrepareHelper.bindStringOrNull(statement, 7, item.getColor());
statement.executeInsert();
}
db.setTransactionSuccessful();
FileLog.i("StatusList: update in db successed");
}catch (Exception ex) {
FileLog.e("StatusList: update in db failed", ex);
DB.STATUSES.deleteOld(accID);
for (Status item : getItems()) {
item.saveToDb();
}
}finally {
db.endTransaction();
}
в том, что в телеграме его почти невозможно читать
Обсуждают сегодня