spring-projects/spring-data-jpa — pull request #112 by liujiong1982 (2014-11-07 06:51:43+00:00)
Title: Issues/datajpa 560

We now support programmatic use of entity graphs
@Entity
@QueryEntity
@NamedEntityGraphs(@NamedEntityGraph(name = GroupInfo.members, attributeNodes = @NamedAttributeNode(members)))
public class GroupInfo {
...
@ManyToMany List members = new ArrayList(); //default fetch mode is lazy.
}
the fetch graph to be used can now configured on a repository query method.
userRepository.getGroup(id, new JpaEntityGraph(GroupInfo.members,EntityGraphType.LOAD));