blob: 71e74c1202bf5e18c19af62466744bcb245447cf (
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 android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.Index;
import android.support.annotation.NonNull;
@Entity(
primaryKeys = {"userId", "boardId"},
indices = {@Index("boardId"), @Index("userId")},
foreignKeys = {
@ForeignKey(entity = Board.class,
parentColumns = "localId",
childColumns = "boardId"),
@ForeignKey(entity = User.class,
parentColumns = "localId",
childColumns = "userId")
})
public class JoinBoardWithUser {
@NonNull
private Long userId;
@NonNull
private Long boardId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getBoardId() {
return boardId;
}
public void setBoardId(Long boardId) {
this.boardId = boardId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JoinBoardWithUser that = (JoinBoardWithUser) o;
if (!userId.equals(that.userId)) return false;
return boardId.equals(that.boardId);
}
@Override
public int hashCode() {
int result = userId.hashCode();
result = 31 * result + boardId.hashCode();
return result;
}
}
|