JPA 2.1 Entity Graph returns duplicated results
I started using the new entity graph feature in JPA 2.1 to specify the Lazy collections that must be loaded. Consider following classes: @Entity @NamedQueries({ @NamedQuery(name="findWithFilterAttr","select a from A a where a.filterAttribute like :filter") }) @NamedEntityGraphs({ @NamedEntityGraph(name = "graph.childs", attributeNodes = @NamedAttributeNode("childs"))}) public class A{ @Id private long id; @OneToMany(mappedBy="parent") private List<B> childs; private String filterAttribute; } @Entity public class B{ @Id private long id; @ManyToOne private A parent; } When I execute the named