+ sha.update(data.toString()
+ .getBytes(StandardCharsets.UTF_8));
+ dataHash = sha.digestToHexString();
+ }
+ catch (NoSuchAlgorithmException e) {
+ throw new RuntimeException(
+ String.format("Unable to get instance of %s digest", DIGEST_TYPE), e);
+ }
+ }
+ public synchronized void loadData(SQLiteDatabase db) {
+ if (dataLoaded)
+ return;
+
+ try (Cursor cTr = db.rawQuery(
+ "SELECT year, month, day, description, comment from transactions WHERE profile=? " +
+ "AND id=?", new String[]{profile, String.valueOf(id)}))
+ {
+ if (cTr.moveToFirst()) {
+ date = new SimpleDate(cTr.getInt(0), cTr.getInt(1), cTr.getInt(2));
+ description = cTr.getString(3);
+ comment = cTr.getString(4);
+
+ accounts.clear();