-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMember.java
More file actions
executable file
·55 lines (42 loc) · 1.59 KB
/
Copy pathMember.java
File metadata and controls
executable file
·55 lines (42 loc) · 1.59 KB
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
package com.okta.entity.member;
import lombok.*;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
@Data
@Entity
@Table(name = "Member")
public class Member {
@Id
@SequenceGenerator(name = "Member_seq", sequenceName = "Member_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "Member_seq")
@Column(name = "Member_id", unique = true, nullable = true)
private @NonNull Long id;
private @NonNull String name;
private @NonNull String email;
private @NonNull String password;
@ManyToOne(fetch = FetchType.EAGER, targetEntity = Title.class)
@JoinColumn(name = "Title_id", insertable = true)
@JsonManagedReference
private @NotNull Title title;
@ManyToOne(fetch = FetchType.EAGER, targetEntity = Faculty.class)
@JoinColumn(name = "Faculty_id", insertable = true)
@JsonManagedReference
private @NotNull Faculty faculty;
@ManyToOne(fetch = FetchType.EAGER, targetEntity = Education.class)
@JoinColumn(name = "Education_id", insertable = true)
@JsonManagedReference
private @NotNull Education education;
public Member() {
}
}