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;}
慕田峪7331174
aluckdog
相关分类