]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/java/net/ktnx/mobileledger/db/PatternAccount.java
2b91c5d10b5903e8c81a277d21f9cb0829dc172a
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / db / PatternAccount.java
1 package net.ktnx.mobileledger.db;
2
3 import androidx.annotation.NonNull;
4 import androidx.room.ColumnInfo;
5 import androidx.room.Entity;
6 import androidx.room.ForeignKey;
7 import androidx.room.Index;
8 import androidx.room.PrimaryKey;
9
10 import org.jetbrains.annotations.NotNull;
11
12 @Entity(tableName = "pattern_accounts",
13         indices = {@Index(name = "un_pattern_accounts", unique = true, value = "id")},
14         foreignKeys = {@ForeignKey(childColumns = "pattern_id", parentColumns = "id",
15                                    entity = PatternHeader.class),
16                        @ForeignKey(childColumns = "currency", parentColumns = "id",
17                                    entity = Currency.class)
18         })
19 public class PatternAccount extends PatternBase {
20     @NonNull
21     @ColumnInfo(name = "pattern_id")
22     private Long patternId;
23     @PrimaryKey(autoGenerate = true)
24     @NotNull
25     private Long id;
26     @ColumnInfo(name = "acc")
27     private String accountName;
28     @ColumnInfo(name = "position")
29     @NonNull
30     private Long position;
31     @ColumnInfo(name = "acc_match_group")
32     private Integer accountNameMatchGroup;
33     @ColumnInfo(name = "currency")
34     private Integer currency;
35     @ColumnInfo(name = "currency_match_group")
36     private Integer currencyMatchGroup;
37     @ColumnInfo(name = "amount")
38     private Float amount;
39     @ColumnInfo(name = "amount_match_group")
40     private Integer amountMatchGroup;
41     @ColumnInfo(name = "comment")
42     private String accountComment;
43     @ColumnInfo(name = "comment_match_group")
44     private Integer accountCommentMatchGroup;
45     public PatternAccount(@NotNull Long id, @NonNull Long patternId, @NonNull Long position) {
46         this.id = id;
47         this.patternId = patternId;
48         this.position = position;
49     }
50     public Long getId() {
51         return id;
52     }
53     public void setId(Long id) {
54         this.id = id;
55     }
56     public @NotNull Long getPatternId() {
57         return patternId;
58     }
59     public void setPatternId(@NonNull Long patternId) {
60         this.patternId = patternId;
61     }
62     @NonNull
63     public String getAccountName() {
64         return accountName;
65     }
66     public void setAccountName(@NonNull String accountName) {
67         this.accountName = accountName;
68     }
69     @NonNull
70     public Long getPosition() {
71         return position;
72     }
73     public void setPosition(@NonNull Long position) {
74         this.position = position;
75     }
76     public void setPosition(int position) {
77         this.position = (long) position;
78     }
79     public Integer getAccountNameMatchGroup() {
80         return accountNameMatchGroup;
81     }
82     public void setAccountNameMatchGroup(Integer accountNameMatchGroup) {
83         this.accountNameMatchGroup = accountNameMatchGroup;
84     }
85     public Integer getCurrency() {
86         return currency;
87     }
88     public void setCurrency(Integer currency) {
89         this.currency = currency;
90     }
91     public Integer getCurrencyMatchGroup() {
92         return currencyMatchGroup;
93     }
94     public void setCurrencyMatchGroup(Integer currencyMatchGroup) {
95         this.currencyMatchGroup = currencyMatchGroup;
96     }
97     public Float getAmount() {
98         return amount;
99     }
100     public void setAmount(Float amount) {
101         this.amount = amount;
102     }
103     public Integer getAmountMatchGroup() {
104         return amountMatchGroup;
105     }
106     public void setAmountMatchGroup(Integer amountMatchGroup) {
107         this.amountMatchGroup = amountMatchGroup;
108     }
109     public String getAccountComment() {
110         return accountComment;
111     }
112     public void setAccountComment(String accountComment) {
113         this.accountComment = accountComment;
114     }
115     public Integer getAccountCommentMatchGroup() {
116         return accountCommentMatchGroup;
117     }
118     public void setAccountCommentMatchGroup(Integer accountCommentMatchGroup) {
119         this.accountCommentMatchGroup = accountCommentMatchGroup;
120     }
121 }