-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathepisode.java
More file actions
30 lines (20 loc) · 789 Bytes
/
Copy pathepisode.java
File metadata and controls
30 lines (20 loc) · 789 Bytes
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
@Entity
public class Episode {
public Episode() {}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name="start_date")
@DateTimeFormat (pattern="dd/MM/yyyy HH:mm")
private Date start_date;
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(name = "episode_person", joinColumns = @JoinColumn(name = "episode_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "person_id", referencedColumnName = "id"))
private List<Person> persons;
@OneToOne(cascade=CascadeType.ALL)
private Address address;
@OneToMany(cascade=CascadeType.ALL)
private List<Stat> stats;
@ManyToOne(cascade = CascadeType.ALL)
private Plan plan;
// Getters & Setters
}