]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/db/Transaction.java
Transaction: when copying, use proper descriptionUpper member
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / db / Transaction.java
index fcbdd82b7fc5d289fa0ff3520c5078ea3d11d246..8b98f923b65f1d698525f7f088f8a04a2b501499 100644 (file)
@@ -61,10 +61,20 @@ public class Transaction {
     @ColumnInfo(collate = ColumnInfo.NOCASE)
     @NonNull
     private String description;
+    @ColumnInfo(name = "description_uc")
+    @NonNull
+    private String descriptionUpper;
     @ColumnInfo
     private String comment;
     @ColumnInfo
     private long generation = 0;
+    @NonNull
+    public String getDescriptionUpper() {
+        return descriptionUpper;
+    }
+    public void setDescriptionUpper(@NonNull String descriptionUpper) {
+        this.descriptionUpper = descriptionUpper;
+    }
     public long getLedgerId() {
         return ledgerId;
     }
@@ -112,6 +122,7 @@ public class Transaction {
     }
     public void setDescription(String description) {
         this.description = description;
+        setDescriptionUpper(description.toUpperCase());
     }
     public String getComment() {
         return comment;
@@ -135,6 +146,7 @@ public class Transaction {
         month = o.month;
         day = o.day;
         description = o.description;
+        descriptionUpper = o.description.toUpperCase();
         comment = o.comment;
         generation = o.generation;
     }