hibernate and mappedBy: Is it possible to automatically set foreign key without setting bidirectional relationship among objects?
问题 Welcome, I have 2 classes: Conversation and Question. One Conversation have many questions. Conversation.java: package com.jcg.jpa.mappedBy; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax