Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 68ce15f

Browse files
author
Rajeev Kumar Singh
committed
Added @manytoone optional
1 parent 29fb202 commit 68ce15f

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/com/example/postgresdemo/model

1 file changed

+1
-1
lines changed

src/main/java/com/example/postgresdemo/model/Answer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Answer extends AuditModel {
2121
@Column(columnDefinition = "text")
2222
private String text;
2323

24-
@ManyToOne(fetch = FetchType.LAZY)
24+
@ManyToOne(fetch = FetchType.LAZY, optional = false)
2525
@JoinColumn(name = "question_id", nullable = false)
2626
@OnDelete(action = OnDeleteAction.CASCADE)
2727
@JsonIgnore

0 commit comments

Comments
 (0)