Package org.hibernate.annotations
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)"
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name used to identify the entity graph in calls to Session.getEntityGraph(String).
-
Element Details
-
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.
-
-
-
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 entity-name of that entity.- Default:
- ""
-