You have the following entities in your project:
@Entity
public class Comment {
@Id
@Column(name = "comment_id")
private long id;
@ManyToOne
@JoinColumn(name = "topic_id")
private Topic topic;
}
@Entity
public class Topic {
@Id
private long id;
@OneToMany(mappedBy = "topic")
private List<Comment> comments = new ArrayList<>();
}
Choose the correct type of relationship between these entities.