Annotation Interface NamedEntityGraph
@Target({TYPE,PACKAGE})
@Retention(RUNTIME)
@Repeatable(NamedEntityGraphs.class)
public @interface NamedEntityGraph
Defines a named entity graph
based on Hibernate's entity graph language.
When applied to a root entity class, the root entity name is implied - e.g. "title, isbn, author(name, books)"
When applied to a package, the root entity name must be specified - e.g. "Book: title, isbn, author(name, books)"
- Since:
- 7.0
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
root
-
name
String nameThe name used to identify the entity graph in calls to Session.getEntityGraph(String). Entity graph names must be unique within the persistence unit.When applied to a root entity class, the name is optional and defaults to the JPA entity name of that entity.
- Default:
""
-
graph
String graphThe textual representation of the graph.When applied to a package, the syntax requires the entity name - e.g.,
"Book: title, isbn, author(name, books)".When applied to an entity, the entity name should be omitted - e.g.,
"title, isbn, author(name, books)".See GraphParser for details about the syntax.
-