Class GraphImpl<J>
- All Implemented Interfaces:
Graph<J>
,Graph<J>
,GraphNode<J>
,GraphImplementor<J>
,GraphNodeImplementor<J>
- Direct Known Subclasses:
RootGraphImpl
,SubGraphImpl
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GraphImpl
(GraphImplementor<J> graph, boolean mutable) GraphImpl
(ManagedDomainType<J> managedType, boolean mutable) protected
GraphImpl
(ManagedDomainType<J> managedType, GraphImplementor<J> graph, boolean mutable) -
Method Summary
Modifier and TypeMethodDescription<Y> AttributeNodeImplementor<Y,
?, ?> addAttributeNode
(Attribute<? super J, Y> attribute) Add anAttributeNode
representing the givenAttribute
to this node of the graph without creating any associatedSubGraph
.<AJ> AttributeNodeImplementor<AJ,
?, ?> addAttributeNode
(String attributeName) <AJ> AttributeNodeImplementor<AJ,
?, ?> addAttributeNode
(PersistentAttribute<? super J, AJ> attribute) final void
addAttributeNodes
(Attribute<? super J, ?>... attributes) void
addAttributeNodes
(String... attributeNames) <E> SubGraphImplementor<E>
addElementSubgraph
(PluralAttribute<? super J, ?, E> attribute) <X> SubGraphImplementor<X>
addElementSubgraph
(String attributeName) Create and return a new (mutable)SubGraph
associated with the element of the namedPluralAttribute
, or return an existing suchSubGraph
if there is one.<X> SubGraphImplementor<X>
addElementSubgraph
(String attributeName, Class<X> type) Create and return a new (mutable)SubGraph
associated with the element of the namedPluralAttribute
, and with the given type, which may be a subtype of the element type, or return an existing suchSubGraph
if there is one.<X> SubGraphImplementor<X>
addKeySubgraph
(String attributeName) <X> SubGraphImplementor<X>
addKeySubgraph
(String attributeName, Class<X> type) <AJ> SubGraphImplementor<AJ>
addKeySubGraph
(String attributeName) <AJ> SubGraphImplementor<AJ>
addKeySubGraph
(String attributeName, Class<AJ> subtype) <AJ> SubGraphImplementor<AJ>
addKeySubGraph
(MapPersistentAttribute<? super J, ? super AJ, ?> attribute, Class<AJ> subtype) <K> SubGraphImplementor<K>
addMapKeySubgraph
(MapAttribute<? super J, K, ?> attribute) <X> SubGraphImplementor<X>
addSubgraph
(Attribute<? super J, X> attribute) <X> SubGraphImplementor<X>
addSubgraph
(String attributeName) <X> SubGraphImplementor<X>
addSubgraph
(String attributeName, Class<X> type) <AJ> SubGraphImplementor<AJ>
addSubGraph
(String attributeName) <AJ> SubGraphImplementor<AJ>
addSubGraph
(String attributeName, Class<AJ> subtype) <AJ> SubGraphImplementor<AJ>
addSubGraph
(PersistentAttribute<? super J, ? super AJ> attribute, Class<AJ> subtype) Create and return a new (mutable)SubGraph
associated with the givenPersistentAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.<AJ> SubGraphImplementor<AJ>
addSubGraph
(PersistentAttribute<? super J, AJ> attribute) <AJ> SubGraph<AJ>
addTreatedElementSubgraph
(PluralAttribute<? super J, ?, ? super AJ> attribute, ManagedType<AJ> type) <E> SubGraphImplementor<E>
addTreatedElementSubgraph
(PluralAttribute<? super J, ?, ? super E> attribute, Class<E> type) <AJ> SubGraphImplementor<AJ>
addTreatedMapKeySubgraph
(MapAttribute<? super J, ? super AJ, ?> attribute, ManagedType<AJ> type) <K> SubGraphImplementor<K>
addTreatedMapKeySubgraph
(MapAttribute<? super J, ? super K, ?> attribute, Class<K> type) <AJ> SubGraphImplementor<AJ>
addTreatedSubgraph
(Attribute<? super J, ? super AJ> attribute, ManagedType<AJ> type) <Y> SubGraphImplementor<Y>
addTreatedSubgraph
(Attribute<? super J, ? super Y> attribute, Class<Y> type) <S extends J>
SubGraphImplementor<S>addTreatedSubgraph
(ManagedType<S> type) <S extends J>
SubGraphImplementor<S>addTreatedSubgraph
(Class<S> type) <AJ> AttributeNodeImplementor<AJ,
?, ?> findAttributeNode
(String attributeName) Find an existingAttributeNode
by name within this container.<AJ> AttributeNodeImplementor<AJ,
?, ?> findAttributeNode
(PersistentAttribute<? super J, AJ> attribute) Find an existingAttributeNode
by corresponding attribute reference, within this container.<AJ> AttributeNodeImplementor<AJ,
?, ?> findOrCreateAttributeNode
(String attributeName) <AJ> AttributeNodeImplementor<AJ,
?, ?> findOrCreateAttributeNode
(PersistentAttribute<? super J, AJ> attribute) <Y> AttributeNodeImplementor<Y,
?, ?> getAttributeNode
(Attribute<? super J, Y> attribute) Find an existingAttributeNode
by corresponding attribute reference, within this container.<Y> AttributeNodeImplementor<Y,
?, ?> getAttributeNode
(String attributeName) Find an existingAttributeNode
by name within this container.List<AttributeNodeImplementor<?,
?, ?>> All nodes belonging to this container.List<AttributeNode<?>>
final ManagedDomainType<J>
The managed type of the node.Map<PersistentAttribute<? super J,
?>, AttributeNodeImplementor<?, ?, ?>> getNodes()
Map<Class<? extends J>,
SubGraphImplementor<? extends J>> makeRootGraph
(String name, boolean mutable) Deprecated, for removal: This API element is subject to removal in a future version.void
merge
(GraphImplementor<J> graph) void
mergeInternal
(GraphImplementor<J> graph) void
removeAttributeNode
(Attribute<? super J, ?> attribute) void
removeAttributeNode
(String attributeName) void
toString()
Methods inherited from class org.hibernate.graph.internal.AbstractGraphNode
isMutable, verifyMutability
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.graph.Graph
addKeySubgraph, addKeySubgraph, addPluralSubgraph, addSubgraph
Methods inherited from interface org.hibernate.graph.spi.GraphImplementor
hasAttributeNode, hasAttributeNode, makeCopy, makeSubGraph
Methods inherited from interface org.hibernate.graph.spi.GraphNodeImplementor
makeCopy
-
Constructor Details
-
GraphImpl
-
GraphImpl
-
GraphImpl
-
-
Method Details
-
getGraphedType
Description copied from interface:Graph
The managed type of the node.- Specified by:
getGraphedType
in interfaceGraph<J>
- Returns:
- the
ManagedType
being graphed here.
-
makeRootGraph
@Deprecated(forRemoval=true) public RootGraphImplementor<J> makeRootGraph(String name, boolean mutable) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:Graph
Create a named root graph representing this node.- Specified by:
makeRootGraph
in interfaceGraph<J>
- Specified by:
makeRootGraph
in interfaceGraphImplementor<J>
mutable
- controls whether the resulting graph is mutable
-
merge
- Specified by:
merge
in interfaceGraphImplementor<J>
-
mergeInternal
- Specified by:
mergeInternal
in interfaceGraphImplementor<J>
-
getAttributeNodeList
Description copied from interface:Graph
All nodes belonging to this container.- Specified by:
getAttributeNodeList
in interfaceGraph<J>
- Specified by:
getAttributeNodeList
in interfaceGraphImplementor<J>
- See Also:
-
findAttributeNode
Description copied from interface:Graph
Find an existingAttributeNode
by name within this container.- Specified by:
findAttributeNode
in interfaceGraph<J>
- Specified by:
findAttributeNode
in interfaceGraphImplementor<J>
-
getAttributeNode
Description copied from interface:Graph
Find an existingAttributeNode
by name within this container.- Specified by:
getAttributeNode
in interfaceGraph<J>
- Specified by:
getAttributeNode
in interfaceGraph<J>
- Specified by:
getAttributeNode
in interfaceGraphImplementor<J>
-
findAttributeNode
public <AJ> AttributeNodeImplementor<AJ,?, findAttributeNode?> (PersistentAttribute<? super J, AJ> attribute) Description copied from interface:Graph
Find an existingAttributeNode
by corresponding attribute reference, within this container.- Specified by:
findAttributeNode
in interfaceGraph<J>
- Specified by:
findAttributeNode
in interfaceGraphImplementor<J>
-
getAttributeNode
Description copied from interface:Graph
Find an existingAttributeNode
by corresponding attribute reference, within this container.- Specified by:
getAttributeNode
in interfaceGraph<J>
- Specified by:
getAttributeNode
in interfaceGraph<J>
- Specified by:
getAttributeNode
in interfaceGraphImplementor<J>
-
getAttributeNodes
- Specified by:
getAttributeNodes
in interfaceGraph<J>
-
getNodes
- Specified by:
getNodes
in interfaceGraphImplementor<J>
-
addAttributeNode
- Specified by:
addAttributeNode
in interfaceGraph<J>
-
addAttributeNode
public <AJ> AttributeNodeImplementor<AJ,?, addAttributeNode?> (PersistentAttribute<? super J, AJ> attribute) - Specified by:
addAttributeNode
in interfaceGraphImplementor<J>
-
addAttributeNode
Description copied from interface:Graph
Add anAttributeNode
representing the givenAttribute
to this node of the graph without creating any associatedSubGraph
.- Specified by:
addAttributeNode
in interfaceGraph<J>
- Specified by:
addAttributeNode
in interfaceGraph<J>
- Specified by:
addAttributeNode
in interfaceGraphImplementor<J>
-
addAttributeNodes
- Specified by:
addAttributeNodes
in interfaceGraph<J>
-
addAttributeNodes
- Specified by:
addAttributeNodes
in interfaceGraph<J>
-
removeAttributeNode
- Specified by:
removeAttributeNode
in interfaceGraph<J>
-
removeAttributeNode
- Specified by:
removeAttributeNode
in interfaceGraph<J>
-
removeAttributeNodes
- Specified by:
removeAttributeNodes
in interfaceGraph<J>
-
findOrCreateAttributeNode
public <AJ> AttributeNodeImplementor<AJ,?, findOrCreateAttributeNode?> (PersistentAttribute<? super J, AJ> attribute) - Specified by:
findOrCreateAttributeNode
in interfaceGraphImplementor<J>
-
findOrCreateAttributeNode
- Specified by:
findOrCreateAttributeNode
in interfaceGraphImplementor<J>
-
addSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the namedAttribute
, or return an existing suchSubGraph
if there is one.- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented type
-
addSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the namedAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented typetype
- A subtype of the attribute type
-
addSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the givenAttribute
of the represented type, or return an existing suchSubGraph
if there is one.- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraph<J>
- Specified by:
addSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- An attribute of the represented type- See Also:
-
addSubGraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the namedAttribute
, or return an existing suchSubGraph
if there is one.- Specified by:
addSubGraph
in interfaceGraph<J>
- Specified by:
addSubGraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented type
-
addSubGraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the namedAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addSubGraph
in interfaceGraph<J>
- Specified by:
addSubGraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented typesubtype
- A subtype of the attribute type
-
addSubGraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the givenAttribute
of the represented type, or return an existing suchSubGraph
if there is one.- Specified by:
addSubGraph
in interfaceGraph<J>
- Specified by:
addSubGraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- An attribute of the represented type- See Also:
-
addSubGraph
public <AJ> SubGraphImplementor<AJ> addSubGraph(PersistentAttribute<? super J, ? super AJ> attribute, Class<AJ> subtype) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the givenPersistentAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addSubGraph
in interfaceGraph<J>
- Specified by:
addSubGraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- An attribute of the represented typesubtype
- A subtype of the attribute type- See Also:
-
addTreatedSubgraph
public <AJ> SubGraphImplementor<AJ> addTreatedSubgraph(Attribute<? super J, ? super AJ> attribute, ManagedType<AJ> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the givenAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addTreatedSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- An attribute of the represented typetype
- A subtype of the attribute type
-
addElementSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the element of the namedPluralAttribute
, or return an existing suchSubGraph
if there is one.- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Parameters:
attributeName
- The name of a collection-valued attribute of the represented type
-
addElementSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the element of the namedPluralAttribute
, and with the given type, which may be a subtype of the element type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Parameters:
attributeName
- The name of a collection-valued attribute of the represented typetype
- A subtype of the element type
-
addElementSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the element of the given collection, or return an existing suchSubGraph
if there is one.- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Specified by:
addElementSubgraph
in interfaceGraph<J>
- Parameters:
attribute
- A collection-valued attribute of the represented type
-
addTreatedElementSubgraph
public <E> SubGraphImplementor<E> addTreatedElementSubgraph(PluralAttribute<? super J, ?, ? super E> attribute, Class<E> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the element of the given collection, and with the given type, which may be a subtype of the element type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the element type, the result is a treated subgraph.
- Specified by:
addTreatedElementSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedElementSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedElementSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- A collection-valued attribute of the represented typetype
- A subtype of the element type
-
addTreatedElementSubgraph
public <AJ> SubGraph<AJ> addTreatedElementSubgraph(PluralAttribute<? super J, ?, ? super AJ> attribute, ManagedType<AJ> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the element of the given collection, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the element type, the result is a treated subgraph.
- Specified by:
addTreatedElementSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedElementSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- A collection-valued attribute of the represented typetype
- A subtype of the element type
-
addKeySubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map or return an existing suchSubGraph
if there is one.- Specified by:
addKeySubgraph
in interfaceGraph<J>
- Specified by:
addKeySubgraph
in interfaceGraph<J>
- Specified by:
addKeySubgraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented type
-
addKeySubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.- Specified by:
addKeySubgraph
in interfaceGraph<J>
- Specified by:
addKeySubgraph
in interfaceGraph<J>
- Specified by:
addKeySubgraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of a map-valued attribute of the represented typetype
- A subtype of the key type
-
addKeySubGraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map or return an existing suchSubGraph
if there is one.- Specified by:
addKeySubGraph
in interfaceGraph<J>
- Specified by:
addKeySubGraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of an attribute of the represented type
-
addKeySubGraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the key type, the result is a treated subgraph.
- Specified by:
addKeySubGraph
in interfaceGraph<J>
- Specified by:
addKeySubGraph
in interfaceGraphImplementor<J>
- Parameters:
attributeName
- The name of a map-valued attribute of the represented typesubtype
- A subtype of the key type
-
addMapKeySubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, or return an existing suchSubGraph
if there is one.- Specified by:
addMapKeySubgraph
in interfaceGraph<J>
- Specified by:
addMapKeySubgraph
in interfaceGraph<J>
- Parameters:
attribute
- A map-valued attribute of the represented type
-
addKeySubGraph
public <AJ> SubGraphImplementor<AJ> addKeySubGraph(MapPersistentAttribute<? super J, ? super AJ, ?> attribute, Class<AJ> subtype) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the key type, the result is a treated subgraph.
- Specified by:
addKeySubGraph
in interfaceGraph<J>
- Specified by:
addKeySubGraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- A map-valued attribute of the represented typesubtype
- A subtype of the key type
-
addTreatedMapKeySubgraph
public <AJ> SubGraphImplementor<AJ> addTreatedMapKeySubgraph(MapAttribute<? super J, ? super AJ, ?> attribute, ManagedType<AJ> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the key type, the result is a treated subgraph.
- Specified by:
addTreatedMapKeySubgraph
in interfaceGraph<J>
- Specified by:
addTreatedMapKeySubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- A map-valued attribute of the represented typetype
- A subtype of the key type
-
addTreatedMapKeySubgraph
public <K> SubGraphImplementor<K> addTreatedMapKeySubgraph(MapAttribute<? super J, ? super K, ?> attribute, Class<K> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the key of the named map, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the key type, the result is a treated subgraph.
- Specified by:
addTreatedMapKeySubgraph
in interfaceGraph<J>
- Specified by:
addTreatedMapKeySubgraph
in interfaceGraph<J>
- Specified by:
addTreatedMapKeySubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- A map-valued attribute of the represented typetype
- A subtype of the key type
-
addTreatedSubgraph
public <Y> SubGraphImplementor<Y> addTreatedSubgraph(Attribute<? super J, ? super Y> attribute, Class<Y> type) Description copied from interface:Graph
Create and return a new (mutable)SubGraph
associated with the givenAttribute
, and with the given type, which may be a subtype of the attribute type, or return an existing suchSubGraph
if there is one.If the given type is a proper subtype of the attribute type, the result is a treated subgraph.
- Specified by:
addTreatedSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedSubgraph
in interfaceGraphImplementor<J>
- Parameters:
attribute
- An attribute of the represented typetype
- A subtype of the attribute type- See Also:
-
addTreatedSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
representing the given subtype of the type of this node, or return an existing suchSubGraph
if there is one.- Specified by:
addTreatedSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedSubgraph
in interfaceGraphImplementor<J>
-
addTreatedSubgraph
Description copied from interface:Graph
Create and return a new (mutable)SubGraph
representing the given subtype of the type of this node, or return an existing suchSubGraph
if there is one.- Specified by:
addTreatedSubgraph
in interfaceGraph<J>
- Specified by:
addTreatedSubgraph
in interfaceGraphImplementor<J>
- See Also:
-
getTreatedSubgraphs
- Specified by:
getTreatedSubgraphs
in interfaceGraphImplementor<J>
-
toString
-