Named Entity Graphs Naming Scope in Spring Data

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Named Entity Graphs Naming Scope in Spring Data



I've recently discovered Named Entity Graphs, and I'm trying to implement them in a clean, DRY way.



What I'm not sure about (and reading through the JPA and Spring Data Docs hasn't answered) is the scope of the names used. Are the private to the classes they're defined in, or can I do something like this:


@Entity
@NamedEntityGraphs(
@NamedEntityGraph(name = "Route.deep",
attributeNodes =
@NamedAttributeNode(value = "stops", subgraph = "Stop.deep ")
)
)
public class Route ...

@Entity
@NamedEntityGraphs(
@NamedEntityGraph(name = "Stop.deep",
attributeNodes =
@NamedAttributeNode(value = "records")
)
)
public class Stop ...



Where the Stop.deep subgraph in Route refers to the named entity graph in Stop.



Thanks!









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

Trying to Print Gridster Items to PDF without overlapping contents

Mass disable jenkins jobs