Package jakarta.persistence
Interface EntityGraph<T>
- 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.
-
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 the entity type of thisEntityGraph
.getName()
Return the name of a namedEntityGraph
(an entity graph defined by means of theNamedEntityGraph
annotation, XML descriptor element, or added by means of theEntityManagerFactory.addNamedEntityGraph(java.lang.String, jakarta.persistence.EntityGraph<T>)
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, getAttributeNode, getAttributeNode, getAttributeNodes, hasAttributeNode, hasAttributeNode, removeAttributeNode, removeAttributeNode, removeAttributeNodes
-
Method Details
-
getName
String getName()Return the name of a namedEntityGraph
(an entity graph defined by means of theNamedEntityGraph
annotation, XML descriptor element, or added by means of theEntityManagerFactory.addNamedEntityGraph(java.lang.String, jakarta.persistence.EntityGraph<T>)
method). Returns null if theEntityGraph
is not a namedEntityGraph
. -
addTreatedSubgraph
Add additional attributes to this entity graph that correspond to attributes of subclasses of the entity type of thisEntityGraph
. Subclass subgraphs 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 the entity type of thisEntityGraph
. Subclass subgraphs 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)