]> git.ktnx.net Git - mobile-ledger.git/commitdiff
rename getPatternAccountDAO() to getTemplateAccountDAO()
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 5 Feb 2021 06:15:37 +0000 (08:15 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 5 Feb 2021 13:16:09 +0000 (13:16 +0000)
app/src/main/java/net/ktnx/mobileledger/db/DB.java
app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplateDetailsViewModel.java

index 136f947d5c115d062a6a2d587510ba17765e742e..1e0a380f97e469572375e99a5e38768413669e2d 100644 (file)
@@ -168,7 +168,7 @@ abstract public class DB extends RoomDatabase {
     }
     public abstract TemplateHeaderDAO getTemplateDAO();
 
-    public abstract TemplateAccountDAO getPatternAccountDAO();
+    public abstract TemplateAccountDAO getTemplateAccountDAO();
 
     public abstract CurrencyDAO getCurrencyDAO();
 }
index fad2d394380b0ce97e735457d90d1843390d2c3d..8a5300ca461df97ffd885a4e0241e600ec329db0 100644 (file)
@@ -154,8 +154,8 @@ public class TemplateDetailsViewModel extends ViewModel {
                             modelHeader));
 
 
-            TemplateAccountDAO paDAO = DB.get()
-                                         .getPatternAccountDAO();
+            TemplateAccountDAO taDAO = DB.get()
+                                         .getTemplateAccountDAO();
             for (int i = 1; i < list.size(); i++) {
                 final TemplateDetailsItem.AccountRow accRowItem = list.get(i)
                                                                       .asAccountRowItem();
@@ -164,10 +164,10 @@ public class TemplateDetailsViewModel extends ViewModel {
                 dbAccount.setPosition(i);
                 if (newPattern) {
                     dbAccount.setId(null);
-                    dbAccount.setId(paDAO.insert(dbAccount));
+                    dbAccount.setId(taDAO.insert(dbAccount));
                 }
                 else
-                    paDAO.update(dbAccount);
+                    taDAO.update(dbAccount);
 
                 Logger.debug("pattern-db", String.format(Locale.US,
                         "Stored pattern account %d, account=%s, comment=%s, neg=%s, item=%s",