File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
polling-app-server/src/main/java/com/example/polls/model Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public class Choice {
2020 @ Size (max = 40 )
2121 private String text ;
2222
23- @ ManyToOne (fetch = FetchType .LAZY )
23+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
2424 @ JoinColumn (name = "poll_id" , nullable = false )
2525 private Poll poll ;
2626
Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ public class Vote extends DateAudit {
1515 @ GeneratedValue (strategy = GenerationType .IDENTITY )
1616 private Long id ;
1717
18- @ ManyToOne (fetch = FetchType .LAZY )
18+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
1919 @ JoinColumn (name = "poll_id" , nullable = false )
2020 private Poll poll ;
2121
22- @ ManyToOne (fetch = FetchType .LAZY )
22+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
2323 @ JoinColumn (name = "choice_id" , nullable = false )
2424 private Choice choice ;
2525
26- @ ManyToOne (fetch = FetchType .LAZY )
26+ @ ManyToOne (fetch = FetchType .LAZY , optional = false )
2727 @ JoinColumn (name = "user_id" , nullable = false )
2828 private User user ;
2929
You can’t perform that action at this time.
0 commit comments