-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDashboard.java
60 lines (52 loc) · 1.38 KB
/
Dashboard.java
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
package com.cruru.dashboard.domain;
import com.cruru.club.domain.Club;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Getter
public class Dashboard {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "dashboard_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "club_id")
private Club club;
public Dashboard(Club club) {
this.club = club;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Dashboard dashboard = (Dashboard) o;
return Objects.equals(id, dashboard.id);
}
@Override
public int hashCode() {
return Objects.hashCode(id);
}
@Override
public String toString() {
return "Dashboard{" +
"id=" + id +
", club=" + club +
'}';
}
}