]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java
DB support for transaction account comments
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / MobileLedgerProfile.java
index 1f2eac7360acc17e5356fa39387363297cc24d63..347e1142408e22ff99c71902938846140dd26722 100644 (file)
@@ -109,7 +109,7 @@ public final class MobileLedgerProfile {
     }
     public static void storeProfilesOrder() {
         SQLiteDatabase db = App.getDatabase();
-        db.beginTransaction();
+        db.beginTransactionNonExclusive();
         try {
             int orderNo = 0;
             for (MobileLedgerProfile p : Data.profiles.getValue()) {
@@ -204,7 +204,7 @@ public final class MobileLedgerProfile {
     }
     public void storeInDB() {
         SQLiteDatabase db = App.getDatabase();
-        db.beginTransaction();
+        db.beginTransactionNonExclusive();
         try {
 //            debug("profiles", String.format("Storing profile in DB: uuid=%s, name=%s, " +
 //                                            "url=%s, permit_posting=%s, authEnabled=%s, " +
@@ -260,9 +260,9 @@ public final class MobileLedgerProfile {
 
         for (LedgerTransactionAccount item : tr.getAccounts()) {
             db.execSQL("INSERT INTO transaction_accounts(profile, transaction_id, " +
-                       "account_name, amount, currency) values(?, ?, ?, ?, ?)",
+                       "account_name, amount, currency, comment) values(?, ?, ?, ?, ?, ?)",
                     new Object[]{uuid, tr.getId(), item.getAccountName(), item.getAmount(),
-                                 item.getCurrency()
+                                 item.getCurrency(), item.getComment()
                     });
         }
 //        debug("profile", String.format("Transaction %d stored", tr.getId()));
@@ -323,7 +323,7 @@ public final class MobileLedgerProfile {
     public void removeFromDB() {
         SQLiteDatabase db = App.getDatabase();
         debug("db", String.format("removing profile %s from DB", uuid));
-        db.beginTransaction();
+        db.beginTransactionNonExclusive();
         try {
             Object[] uuid_param = new Object[]{uuid};
             db.execSQL("delete from profiles where uuid=?", uuid_param);