Entity graph

@NamedEntityGraphs(
        @NamedEntityGraph(name="allJoins",
                attributeNodes = {
                    @NamedAttributeNode(value = "lead", subgraph = "allJoins.lead.section"),
                    @NamedAttributeNode("reviewer"),
                    @NamedAttributeNode("loginLocation"),
                    @NamedAttributeNode("departmentSection"),
                    @NamedAttributeNode("customer"),
                    @NamedAttributeNode("workType"),
                        // This actually seems to slow it down, when querying just one at least.
//                  @NamedAttributeNode("parts"),
                },
                subgraphs = {
                        @NamedSubgraph(name = "allJoins.lead.section",
                            attributeNodes = {
                                @NamedAttributeNode("section")
                            }
                            ),
                        @NamedSubgraph(name = "allJoins.reviewer.section",
                                attributeNodes = {
                                        @NamedAttributeNode("section")
                                }
                        )
                }
        )
)

Comments