JPA: EntityGraph and map
问题 I use EclipseLink 2.6.3 as JPA provider. I have two entities: @Entity public class ClassA{ @Id private String uuid; private String comment; @OneToMany(fetch = FetchType.EAGER,cascade = CascadeType.ALL,mappedBy = "classA",orphanRemoval = false) @MapKey(name="code") private Map<String,ClassB> texts; //+ getters and setters } @Entity public class ClassB { @Id private String uuid; private String code; private String name; @ManyToOne @JoinColumn(name = "comeColname") private ClassA classA; //