Questions tagged «bag»

15
Hibernate引发MultipleBagFetchException-无法同时获取多个包
Hibernate在创建SessionFactory时抛出此异常: org.hibernate.loader.MultipleBagFetchException:无法同时获取多个包 这是我的测试用例: Parent.java @Entity public 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 @Entity public Child { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; …
471 java  hibernate  jpa  one-to-many  bag 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.