Package org.hibernate.graph
Interface Graph<J>
-
- All Superinterfaces:
GraphNode<J>
- All Known Subinterfaces:
GraphImplementor<J>
,RootGraph<J>
,RootGraphImplementor<J>
,SubGraph<J>
,SubGraphImplementor<J>
- All Known Implementing Classes:
AbstractGraph
,RootGraphImpl
,SubGraphImpl
public interface Graph<J> extends GraphNode<J>
A container forAttributeNode
references.- See Also:
RootGraph
,SubGraph
,EntityGraph
,Subgraph
- API Note:
- Acts as an abstraction over the JPA-defined interfaces
EntityGraph
andSubgraph
, which have no common supertype.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <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<?>>
getAttributeNodeList()
Get a list of all existing AttributeNodes within this container.List<AttributeNode<?>>
getGraphAttributeNodes()
Ultimately only needed for implementingEntityGraph.getAttributeNodes()
andSubgraph.getAttributeNodes()
ManagedDomainType<J>
getGraphedType()
Graphs apply only toManagedType
s.Graph<J>
makeCopy(boolean mutable)
RootGraph<J>
makeRootGraph(String name, boolean mutable)
Create a named rootGraph
if the given name is not null.SubGraph<J>
makeSubGraph(boolean mutable)
-
-
-
Method Detail
-
addPluralSubgraph
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.- 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
RootGraph<J> makeRootGraph(String name, boolean mutable) throws CannotBecomeEntityGraphException
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
-
getGraphAttributeNodes
List<AttributeNode<?>> getGraphAttributeNodes()
Ultimately only needed for implementingEntityGraph.getAttributeNodes()
andSubgraph.getAttributeNodes()
-
findAttributeNode
<AJ> AttributeNode<AJ> findAttributeNode(String attributeName)
Find an already existing AttributeNode by attributeName within this container
-
findAttributeNode
<AJ> AttributeNode<AJ> findAttributeNode(PersistentAttribute<? extends J,AJ> attribute)
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
<AJ> AttributeNode<AJ> addAttributeNode(String attributeName)
Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute name.
-
addAttributeNode
<AJ> AttributeNode<AJ> addAttributeNode(PersistentAttribute<? extends J,AJ> attribute)
Add anAttributeNode
(with no associatedSubGraph
) to this container by attribute reference.
-
addSubGraph
<AJ> SubGraph<AJ> addSubGraph(String attributeName) throws CannotContainSubGraphException
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 CannotContainSubGraphException
Create 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
<AJ> SubGraph<AJ> addKeySubGraph(String attributeName) throws CannotContainSubGraphException
- 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
-
-