Top Description Methods
org.hibernate.graph

public Interface RootGraph<J>

extends Graph<J>, EntityGraph<J>
Known Direct Subinterfaces
org.hibernate.graph.spi.RootGraphImplementor
Imports
java.util.List, jakarta.persistence.AttributeNode, .EntityGraph, .Subgraph, jakarta.persistence.metamodel.Attribute, org.hibernate.metamodel.model.domain.PersistentAttribute

Extends the JPA-defined EntityGraph with additional operations.
Authors
Steve Ebersole, Andrea Boriero
See Also
SubGraph

Method Summary

Modifier and TypeMethod and Description
public default void
addAttributeNodes(String...
name of the attribute
names
)

Implements jakarta.persistence.EntityGraph.addAttributeNodes.

Add one or more attribute nodes to the entity graph.
public default void
addAttributeNodes(Attribute<J, ?>...
attribute
attributes
)

Implements jakarta.persistence.EntityGraph.addAttributeNodes.

Add one or more attribute nodes to the entity graph.
public default <X> SubGraph<X>
addKeySubgraph(Attribute<J, X>
attribute
attribute
)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type.
public default <X> SubGraph<? extends X>
addKeySubgraph(Attribute<J, X>
attribute
attribute
,
Class<? extends X>
entity subclass
type
)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type with inheritance.
public default <X> SubGraph<X>
addKeySubgraph(String
name of the attribute
name
)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type.
public default <X> Subgraph<X>
addKeySubgraph(String
name of the attribute
name
,
Class<X>
entity subclass
type
)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type with inheritance.
public <T1> SubGraph<? extends T1>
addSubclassSubgraph(Class<? extends T1>
entity subclass
type
)

Redeclares jakarta.persistence.EntityGraph.addSubclassSubgraph.

Add additional attributes to this entity graph that correspond to attributes of subclasses of this EntityGraph's entity type.
public default <X> SubGraph<X>
addSubgraph(Attribute<J, X>
attribute
attribute
)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type.
public default <X> SubGraph<? extends X>
addSubgraph(Attribute<J, X>
attribute
attribute
,
Class<? extends X>
entity subclass
type
)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type with inheritance.
public default <X> SubGraph<X>
addSubgraph(String
name of the attribute
name
)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type.
public default <X> SubGraph<X>
addSubgraph(String
name of the attribute
name
,
Class<X>
entity subclass
type
)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type with inheritance.
public default List<AttributeNode<?>>
getAttributeNodes()

Implements jakarta.persistence.EntityGraph.getAttributeNodes.

Return the attribute nodes of this entity that are included in the entity graph.
public RootGraph<J>
makeRootGraph(String name, boolean
controls whether the resulting Graph is mutable
mutable
)

Redeclares org.hibernate.graph.Graph.makeRootGraph.

Create a named root Graph if the given name is not null.
public SubGraph<J>
makeSubGraph(boolean mutable)

Redeclares org.hibernate.graph.Graph.makeSubGraph.

Create a new (mutable or immutable) SubGraph rooted at this Graph.
Inherited from jakarta.persistence.EntityGraph:
getName
Inherited from org.hibernate.graph.Graph:
addAttributeNodeaddAttributeNodeaddKeySubGraphaddKeySubGraphaddKeySubGraphaddKeySubGraphaddPluralSubgraphaddSubGraphaddSubGraphaddSubGraphaddSubGraphfindAttributeNodefindAttributeNodegetAttributeNodeListgetGraphAttributeNodesgetGraphedTypemakeCopy

Method Detail

addAttributeNodesback to summary
public default void addAttributeNodes(String... names)

Implements jakarta.persistence.EntityGraph.addAttributeNodes.

Doc from jakarta.persistence.EntityGraph.addAttributeNodes.

Add one or more attribute nodes to the entity graph.

Parameters
names:String[]

name of the attribute

Annotations
@Override
addAttributeNodesback to summary
public default void addAttributeNodes(Attribute<J, ?>... attributes)

Implements jakarta.persistence.EntityGraph.addAttributeNodes.

Doc from jakarta.persistence.EntityGraph.addAttributeNodes.

Add one or more attribute nodes to the entity graph.

Parameters
attributes:Attribute<J, ?>[]

attribute

Annotations
@Override
@SuppressWarnings:unchecked
addKeySubgraphback to summary
public default <X> SubGraph<X> addKeySubgraph(Attribute<J, X> attribute)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Doc from jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type. This allows for construction of multi-node entity graphs that include related managed types.

Parameters
attribute:Attribute<J, X>

attribute

Returns:SubGraph<X>

subgraph for the key attribute

Annotations
@Override
addKeySubgraphback to summary
public default <X> SubGraph<? extends X> addKeySubgraph(Attribute<J, X> attribute, Class<? extends X> type)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Doc from jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type with inheritance. This allows for construction of multi-node entity graphs that include related managed types. Subclass subgraphs will include the specified attributes of superclass subgraphs.

Parameters
attribute:Attribute<J, X>

attribute

type:Class<? extends X>

entity subclass

Returns:SubGraph<? extends X>

subgraph for the key attribute

Annotations
@Override
addKeySubgraphback to summary
public default <X> SubGraph<X> addKeySubgraph(String name)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Doc from jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type. This allows for construction of multi-node entity graphs that include related managed types.

Parameters
name:String

name of the attribute

Returns:SubGraph<X>

subgraph for the key attribute

Annotations
@Override
addKeySubgraphback to summary
public default <X> Subgraph<X> addKeySubgraph(String name, Class<X> type)

Implements jakarta.persistence.EntityGraph.addKeySubgraph.

Doc from jakarta.persistence.EntityGraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type with inheritance. This allows for construction of multi-node entity graphs that include related managed types. Subclass subgraphs will automatically include the specified attributes of superclass subgraphs

Parameters
name:String

name of the attribute

type:Class<X>

entity subclass

Returns:Subgraph<X>

subgraph for the key attribute

Annotations
@Override
addSubclassSubgraphback to summary
public <T1> SubGraph<? extends T1> addSubclassSubgraph(Class<? extends T1> type)

Redeclares jakarta.persistence.EntityGraph.addSubclassSubgraph.

Doc from jakarta.persistence.EntityGraph.addSubclassSubgraph.

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:Class<? extends T1>

entity subclass

Returns:SubGraph<? extends T1>

subgraph for the subclass

Annotations
@Override
addSubgraphback to summary
public default <X> SubGraph<X> addSubgraph(Attribute<J, X> attribute)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Doc from jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type. This allows for construction of multi-node entity graphs that include related managed types.

Parameters
attribute:Attribute<J, X>

attribute

Returns:SubGraph<X>

subgraph for the attribute

Annotations
@Override
addSubgraphback to summary
public default <X> SubGraph<? extends X> addSubgraph(Attribute<J, X> attribute, Class<? extends X> type)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Doc from jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type with inheritance. This allows for multiple subclass subgraphs to be defined for this node of the entity graph. Subclass subgraphs will automatically include the specified attributes of superclass subgraphs.

Parameters
attribute:Attribute<J, X>

attribute

type:Class<? extends X>

entity subclass

Returns:SubGraph<? extends X>

subgraph for the attribute

Annotations
@Override
addSubgraphback to summary
public default <X> SubGraph<X> addSubgraph(String name)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Doc from jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type. This allows for construction of multi-node entity graphs that include related managed types.

Parameters
name:String

name of the attribute

Returns:SubGraph<X>

subgraph for the attribute

Annotations
@Override
addSubgraphback to summary
public default <X> SubGraph<X> addSubgraph(String name, Class<X> type)

Implements jakarta.persistence.EntityGraph.addSubgraph.

Doc from jakarta.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type with inheritance. This allows for multiple subclass subgraphs to be defined for this node of the entity graph. Subclass subgraphs will automatically include the specified attributes of superclass subgraphs.

Parameters
name:String

name of the attribute

type:Class<X>

entity subclass

Returns:SubGraph<X>

subgraph for the attribute

Annotations
@Override
getAttributeNodesback to summary
public default List<AttributeNode<?>> getAttributeNodes()

Implements jakarta.persistence.EntityGraph.getAttributeNodes.

Doc from jakarta.persistence.EntityGraph.getAttributeNodes.

Return the attribute nodes of this entity that are included in the entity graph.

Returns:List<AttributeNode<?>>

attribute nodes for the annotated entity type or empty list if none have been defined

Annotations
@Override
@SuppressWarnings:unchecked, rawtypes
makeRootGraphback to summary
public RootGraph<J> makeRootGraph(String name, boolean mutable)

Redeclares org.hibernate.graph.Graph.makeRootGraph.

Doc from org.hibernate.graph.Graph.makeRootGraph.

Create a named root Graph if the given name is not null.

Parameters
mutable:boolean

controls whether the resulting Graph is mutable

Annotations
@Override
makeSubGraphback to summary
public SubGraph<J> makeSubGraph(boolean mutable)

Redeclares org.hibernate.graph.Graph.makeSubGraph.

Doc from org.hibernate.graph.Graph.makeSubGraph.

Create a new (mutable or immutable) SubGraph rooted at this Graph.