Package org.hibernate.graph
Interface Graph<J>
- All Superinterfaces:
GraphNode<J>
- All Known Subinterfaces:
GraphImplementor<J>
,RootGraph<J>
,RootGraphImplementor<J>
,SubGraph<J>
,SubGraphImplementor<J>
A container for
AttributeNode
references.- See Also:
- API Note:
- Acts as an abstraction over the JPA-defined interfaces
EntityGraph
andSubgraph
, which have no common supertype.
-
Method Summary
Modifier and TypeMethodDescription<AJ> AttributeNode<AJ>
addAttributeNode
(String attributeName) Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute name.<AJ> AttributeNode<AJ>
addAttributeNode
(PersistentAttribute<? extends J, AJ> attribute) Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute reference.<AJ> SubGraph<AJ>
addKeySubGraph
(String attributeName) <AJ> SubGraph<AJ>
addKeySubGraph
(String attributeName, Class<AJ> type) <AJ> SubGraph<AJ>
addKeySubGraph
(PersistentAttribute<? extends J, AJ> attribute) <AJ> SubGraph<? extends AJ>
addKeySubGraph
(PersistentAttribute<? extends J, AJ> attribute, Class<? extends AJ> type) default <AJ> SubGraph<AJ>
addPluralSubgraph
(PluralAttribute<? extends J, ?, AJ> attribute) Add a subgraph rooted at a plural attribute, allowing further nodes to be added to the subgraph.<AJ> SubGraph<AJ>
addSubGraph
(String attributeName) Create and return a new (mutable)SubGraph
associated with the namedAttributeNode
.<AJ> SubGraph<AJ>
addSubGraph
(String attributeName, Class<AJ> type) <AJ> SubGraph<AJ>
addSubGraph
(PersistentAttribute<? extends J, AJ> attribute) Create and return a new (mutable)SubGraph
associated with theAttributeNode
for the given attribute.<AJ> SubGraph<? extends AJ>
addSubGraph
(PersistentAttribute<? extends J, AJ> attribute, Class<? extends AJ> type) <AJ> AttributeNode<AJ>
findAttributeNode
(String attributeName) Find an already existing AttributeNode by attributeName within this container<AJ> AttributeNode<AJ>
findAttributeNode
(PersistentAttribute<? extends J, AJ> attribute) Find an already existing AttributeNode by corresponding attribute reference, within this container.List<AttributeNode<?>>
Get a list of all existing AttributeNodes within this container.List<AttributeNode<?>>
Ultimately only needed for implementingEntityGraph.getAttributeNodes()
andSubgraph.getAttributeNodes()
Graphs apply only toManagedType
s.makeCopy
(boolean mutable) makeRootGraph
(String name, boolean mutable) Create a named rootGraph
if the given name is not null.makeSubGraph
(boolean mutable)
-
Method Details
-
addPluralSubgraph
Add a subgraph rooted at a plural attribute, allowing further nodes to be added to the subgraph.- Since:
- 6.3
- API Note:
- This method is missing in JPA, and nodes cannot be added in a typesafe way to subgraphs representing fetched collections
-
getGraphedType
ManagedDomainType<J> getGraphedType()Graphs apply only toManagedType
s.- Returns:
- the
ManagedType
being graphed here.
-
makeRootGraph
Create a named rootGraph
if the given name is not null.- Parameters:
mutable
- controls whether the resultingGraph
is mutable- Throws:
CannotBecomeEntityGraphException
- If the named attribute is not entity-valued
-
makeSubGraph
-
makeCopy
-
getGraphAttributeNodes
List<AttributeNode<?>> getGraphAttributeNodes()Ultimately only needed for implementingEntityGraph.getAttributeNodes()
andSubgraph.getAttributeNodes()
-
findAttributeNode
Find an already existing AttributeNode by attributeName within this container -
findAttributeNode
Find an already existing AttributeNode by corresponding attribute reference, within this container. -
getAttributeNodeList
List<AttributeNode<?>> getAttributeNodeList()Get a list of all existing AttributeNodes within this container. -
addAttributeNode
Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute name. -
addAttributeNode
Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute reference. -
addSubGraph
Create and return a new (mutable)SubGraph
associated with the namedAttributeNode
.- Throws:
CannotContainSubGraphException
- API Note:
- If no such AttributeNode exists yet, it is created.
-
addSubGraph
<AJ> SubGraph<AJ> addSubGraph(String attributeName, Class<AJ> type) throws CannotContainSubGraphException - Throws:
CannotContainSubGraphException
-
addSubGraph
<AJ> SubGraph<AJ> addSubGraph(PersistentAttribute<? extends J, AJ> attribute) throws CannotContainSubGraphExceptionCreate and return a new (mutable)SubGraph
associated with theAttributeNode
for the given attribute.- Throws:
CannotContainSubGraphException
- API Note:
- If no such AttributeNode exists yet, it is created.
-
addSubGraph
<AJ> SubGraph<? extends AJ> addSubGraph(PersistentAttribute<? extends J, AJ> attribute, Class<? extends AJ> type) throws CannotContainSubGraphException- Throws:
CannotContainSubGraphException
-
addKeySubGraph
- Throws:
CannotContainSubGraphException
-
addKeySubGraph
<AJ> SubGraph<AJ> addKeySubGraph(String attributeName, Class<AJ> type) throws CannotContainSubGraphException - Throws:
CannotContainSubGraphException
-
addKeySubGraph
<AJ> SubGraph<AJ> addKeySubGraph(PersistentAttribute<? extends J, AJ> attribute) throws CannotContainSubGraphException- Throws:
CannotContainSubGraphException
-
addKeySubGraph
<AJ> SubGraph<? extends AJ> addKeySubGraph(PersistentAttribute<? extends J, AJ> attribute, Class<? extends AJ> type) throws CannotContainSubGraphException- Throws:
CannotContainSubGraphException
-