各位大师,请教一个问题。
我这里有1个实体,4个值对象(ServicePlanSuite是实体,其他都是值对象),关系分别如下:
ServicePlanSuite 和 ServicePlan 是一对多关系,双向关联
ServicePlan 和 SubservicePlan 是一对多关系,双向关联
SubservicePlan 和 HumanResourceRequirement 以及 FacilityResourceRequirement是一对多关系
之前就算不是双向关联,这样写也会报一个这样一个错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.util.ConcurrentModificationException
@Entity
public class ServicePlanSuite {
@Id
@GeneratedValue
private long id; @ElementCollection
private List<ServicePlan> servicePlans;
}@Embeddable
public class ServicePlan {
    //双向关联用什么注解?
private ServicePlanSuite servicePlanSuite;
    @ElementCollection
private List<SubservicePlan> subservicePlans;
}@Embeddable
public class SubservicePlan {
    //双向关联用什么注解?
private ServicePlan servicePlan;
    @ElementCollection
private List<HumanResourceRequirement> humanResourceRequirements;
@ElementCollection
private List<FacilityResourceRequirement> facilityResourceRequirements;
}谢谢!