blob: 2da1c0b796323789bfe9e898045bf6cb38343246 (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
package it.niedermann.nextcloud.deck.model.widget.filter;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import it.niedermann.nextcloud.deck.model.Stack;
@Entity(
indices = {
@Index(value = "filterBoardId", name = "idx_FilterWidgetStack_filterBoardId"),
@Index(value = "stackId", name = "idx_FilterWidgetStack_stackId")
},
foreignKeys = {
@ForeignKey(
entity = Stack.class,
parentColumns = "localId",
childColumns = "stackId", onDelete = ForeignKey.CASCADE
),
@ForeignKey(
entity = FilterWidgetBoard.class,
parentColumns = "id",
childColumns = "filterBoardId", onDelete = ForeignKey.CASCADE
)
}
)
public class FilterWidgetStack {
@PrimaryKey(autoGenerate = true)
private Long id;
private Long filterBoardId;
private Long stackId;
public FilterWidgetStack() {
// Default constructor
}
@Ignore
public FilterWidgetStack(Long stackId) {
this.stackId = stackId;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getFilterBoardId() {
return filterBoardId;
}
public void setFilterBoardId(Long filterBoardId) {
this.filterBoardId = filterBoardId;
}
public Long getStackId() {
return stackId;
}
public void setStackId(Long stackId) {
this.stackId = stackId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FilterWidgetStack that = (FilterWidgetStack) o;
if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (filterBoardId != null ? !filterBoardId.equals(that.filterBoardId) : that.filterBoardId != null)
return false;
return stackId != null ? stackId.equals(that.stackId) : that.stackId == null;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (filterBoardId != null ? filterBoardId.hashCode() : 0);
result = 31 * result + (stackId != null ? stackId.hashCode() : 0);
return result;
}
}
|