org.hibernate.loader.MultipleBagFetchException:不能同时获取多个包
Parent.java
@Entitypublic Parent {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
// @IndexColumn(name="INDEX_COL") if I had this the problem solve but I retrieve more children than I have, one child is null.
private List<Child> children;}Child.java
@Entitypublic Child {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
@ManyToOne
private Parent parent;}
烙印99
慕田峪7331174
aluckdog
随时随地看视频慕课网APP
相关分类