File tree 2 files changed +4
-4
lines changed
polling-app-server/src/main/java/com/example/polls/model
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Choice {
20
20
@ Size (max = 40 )
21
21
private String text ;
22
22
23
- @ ManyToOne (fetch = FetchType .LAZY )
23
+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
24
24
@ JoinColumn (name = "poll_id" , nullable = false )
25
25
private Poll poll ;
26
26
Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ public class Vote extends DateAudit {
15
15
@ GeneratedValue (strategy = GenerationType .IDENTITY )
16
16
private Long id ;
17
17
18
- @ ManyToOne (fetch = FetchType .LAZY )
18
+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
19
19
@ JoinColumn (name = "poll_id" , nullable = false )
20
20
private Poll poll ;
21
21
22
- @ ManyToOne (fetch = FetchType .LAZY )
22
+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
23
23
@ JoinColumn (name = "choice_id" , nullable = false )
24
24
private Choice choice ;
25
25
26
- @ ManyToOne (fetch = FetchType .LAZY )
26
+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
27
27
@ JoinColumn (name = "user_id" , nullable = false )
28
28
private User user ;
29
29
You can’t perform that action at this time.
0 commit comments