1// Business Object 1:
2
3@Entity
4@Table(name = "ta_trainee", uniqueConstraints = {@UniqueConstraint(columnNames = {"id"})})
5public class Trainee extends BusinessObject {
6
7 @OneToMany(mappedBy = "trainee", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
8 @Column(nullable = true)
9 @JsonManagedReference
10 private Set<BodyStat> bodyStats;
11
12// Business Object 2:
13
14@Entity
15@Table(name = "ta_bodystat", uniqueConstraints = {@UniqueConstraint(columnNames = {"id"})})
16public class BodyStat extends BusinessObject {
17
18 @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
19 @JoinColumn(name="trainee_fk")
20 @JsonBackReference
21 private Trainee trainee;