- Type Parameters:
T
- The type of the root entity.
- All Superinterfaces:
Graph<T>
This type represents the root of an entity graph that will be used
as a template to define the attribute nodes and boundaries of a
graph of entities and entity relationships. The root must be an
entity type.
The methods to add subgraphs implicitly create the corresponding attribute nodes as well; such attribute nodes should not be redundantly specified.
- Since:
- 2.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> Subgraph<? extends T>
addSubclassSubgraph
(Class<? extends T> type) Deprecated, for removal: This API element is subject to removal in a future version.addTreatedSubgraph
(Class<S> type) Add additional attributes to this entity graph that correspond to attributes of subclasses of this EntityGraph's entity type.getName()
Return the name of a named EntityGraph (an entity graph defined by means of theNamedEntityGraph
annotation, XML descriptor element, or added by means of theaddNamedEntityGraph
method).Methods inherited from interface jakarta.persistence.Graph
addAttributeNode, addAttributeNode, addAttributeNodes, addAttributeNodes, addElementSubgraph, addElementSubgraph, addElementSubgraph, addKeySubgraph, addKeySubgraph, addKeySubgraph, addKeySubgraph, addMapKeySubgraph, addSubgraph, addSubgraph, addSubgraph, addSubgraph, addTreatedElementSubgraph, addTreatedMapKeySubgraph, addTreatedSubgraph, getAttributeNodes, removeAttributeNode, removeAttributeNode, removeAttributeNodes
-
Method Details
-
getName
String getName()Return the name of a named EntityGraph (an entity graph defined by means of theNamedEntityGraph
annotation, XML descriptor element, or added by means of theaddNamedEntityGraph
method). Returns null if the EntityGraph is not a named EntityGraph. -
addTreatedSubgraph
Add additional attributes to this entity graph that correspond to attributes of subclasses of this EntityGraph's entity type. Subclass subgraphs will automatically include the specified attributes of superclass subgraphs.- Parameters:
type
- entity subclass- Returns:
- subgraph for the subclass
- Throws:
IllegalArgumentException
- if the type is not an entity typeIllegalStateException
- if the EntityGraph has been statically defined
-
addSubclassSubgraph
@Deprecated(since="3.2", forRemoval=true) <T> Subgraph<? extends T> addSubclassSubgraph(Class<? extends T> type) Deprecated, for removal: This API element is subject to removal in a future version.Add additional attributes to this entity graph that correspond to attributes of subclasses of this EntityGraph's entity type. Subclass subgraphs will automatically include the specified attributes of superclass subgraphs.- Parameters:
type
- entity subclass- Returns:
- subgraph for the subclass
- Throws:
IllegalArgumentException
- if the type is not an entity typeIllegalStateException
- if the EntityGraph has been statically defined
-
addTreatedSubgraph(Class)