blob: e827fa3203a809e088ed73a2bd49144fdbe53306 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
package it.niedermann.nextcloud.deck.model;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.annotation.NonNull;
@Entity(
primaryKeys = {"labelId", "cardId"},
indices = {@Index("cardId"), @Index("labelId")},
foreignKeys = {
@ForeignKey(entity = Label.class,
parentColumns = "localId",
childColumns = "labelId"),
@ForeignKey(entity = Card.class,
parentColumns = "localId",
childColumns = "cardId")
})
public class JoinCardWithLabel {
@NonNull
private Long labelId;
@NonNull
private Long cardId;
public Long getLabelId() {
return labelId;
}
public void setLabelId(Long labelId) {
this.labelId = labelId;
}
public Long getCardId() {
return cardId;
}
public void setCardId(Long cardId) {
this.cardId = cardId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JoinCardWithLabel that = (JoinCardWithLabel) o;
if (!labelId.equals(that.labelId)) return false;
return cardId.equals(that.cardId);
}
@Override
public int hashCode() {
int result = labelId.hashCode();
result = 31 * result + cardId.hashCode();
return result;
}
}
|