Package org.hibernate.annotations
Annotation Interface NamedEntityGraph
@Target({TYPE,PACKAGE})@Retention(RUNTIME)@Repeatable(NamedEntityGraphs.class)public @interfaceNamedEntityGraph
Defines a namedentity graph based on Hibernate'sentity 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 ElementsOptional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name used to identify the entity graph in calls toSession.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)". SeeGraphParser for details about the syntax.
name
String nameThe name used to identify the entity graph in calls toSession.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:
- ""