I'm getting this exception when I try to save a topic with a message: nested exception is javax.persistence.EntityNotFoundException: Unable to find mypackage.model.Message with id fb8d39ea-0094-410d-975a-ea4495781422
Here is the model :
@Entity
public class Topic {
@Id
private String id;
private String title;
private String projectName;
private String author;
@OneToMany(mappedBy = "topicId")
private Set<Message> messages;
public Topic() {
this.messages = new HashSet<>();
}
}
@Entity
public class Message {
@Id
private String id;
private String author;
private String content;
private String …Run Code Online (Sandbox Code Playgroud)