Package javax.persistence
Annotation Type NamedEntityGraph
-
@Target(TYPE) @Retention(RUNTIME) @Repeatable(NamedEntityGraphs.class) public @interface NamedEntityGraph
The NamedEntityGraph annotation is used to define a named entity graph. The entity graph may be retrieved by name using the EntityManagerFactory interface. The entity graph may be used to specify the path and boundaries for find operations or queries. The NamedEntityGraph annotation must be applied to the entity class that forms the root of the corresponding graph of entities.- Since:
- JPA 2.1
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description NamedAttributeNode[]attributeNodesThe attributeNodes element lists attributes of the annotated entity class that are to be included in the entity graph.booleanincludeAllAttributesThe includeAllAttributes element specifies that all attributes of the annotated entity class are to be included in the entity graph.StringnameThe name element is used to refer to the entity graph.NamedSubgraph[]subclassSubgraphsThe subclassSubgraphs element specifies a list of subgraphs that add additional attributes for subclasses of the root entity to which the annotation is applied.NamedSubgraph[]subgraphsThe subgraphs element specifies a list of subgraphs, further specifying attributes that are managed types.
-
-
-
-
attributeNodes
NamedAttributeNode[] attributeNodes
The attributeNodes element lists attributes of the annotated entity class that are to be included in the entity graph.- Returns:
- The nodes
- Default:
- {}
-
-
-
includeAllAttributes
boolean includeAllAttributes
The includeAllAttributes element specifies that all attributes of the annotated entity class are to be included in the entity graph. An attributeNode element may still be used in conjunction with this element to specify a subgraph for the attribute.- Returns:
- Whether to include attrs
- Default:
- false
-
-
-
subgraphs
NamedSubgraph[] subgraphs
The subgraphs element specifies a list of subgraphs, further specifying attributes that are managed types. These subgraphs are referenced by name from NamedAttributeNode definitions.- Returns:
- the subgraphs
- Default:
- {}
-
-
-
subclassSubgraphs
NamedSubgraph[] subclassSubgraphs
The subclassSubgraphs element specifies a list of subgraphs that add additional attributes for subclasses of the root entity to which the annotation is applied.- Returns:
- The subclass graphs
- Default:
- {}
-
-