]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/db/Transaction.java
fix looking up old transactions with non-ASCII names (broken in 0.18.0)
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / db / Transaction.java
index 05e63d8c0e92dd05c3db2aa48603a65159d5cd6e..30395409bdc1d7a270234f46a3430d7bc893be6a 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 int generation = 0;
+    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;
@@ -119,11 +130,23 @@ public class Transaction {
     public void setComment(String comment) {
         this.comment = comment;
     }
-    public int getGeneration() {
+    public long getGeneration() {
         return generation;
     }
-    public void setGeneration(int generation) {
+    public void setGeneration(long generation) {
         this.generation = generation;
     }
 
+    public void copyDataFrom(Transaction o) {
+        // id = o.id;
+        ledgerId = o.ledgerId;
+        profileId = o.profileId;
+        dataHash = o.dataHash;
+        year = o.year;
+        month = o.month;
+        day = o.day;
+        description = o.description;
+        comment = o.comment;
+        generation = o.generation;
+    }
 }