one-to-many级联保存

保存one级联保存many

 

 

@OneToMany(mappedBy = "query")

@Cascade(value=CascadeType.SAVE_UPDATE)

@LazyCollection(value=LazyCollectionOption.FALSE)

private List<AttrDetail> attrDetails;

 

调用save(query), 所有的AttrDetail自动级联保存

 

你可能感兴趣的:(one-to-many)