Top Description Methods
org.hibernate.graph

public Interface SubGraph<J>

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

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

Method Summary

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

Implements jakarta.persistence.Subgraph.addAttributeNodes.

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

Implements jakarta.persistence.Subgraph.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.Subgraph.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.Subgraph.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.Subgraph.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.Subgraph.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>
addSubgraph(Attribute<J, X>
attribute
attribute
)

Implements jakarta.persistence.Subgraph.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.Subgraph.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.Subgraph.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.Subgraph.addSubgraph.

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

Implements jakarta.persistence.Subgraph.getAttributeNodes.

Return the attribute nodes corresponding to the attributes of this managed type that are included in the subgraph.
public default Class<J>
getClassType()

Implements jakarta.persistence.Subgraph.getClassType.

Return the type for which this subgraph was defined.
Inherited from org.hibernate.graph.Graph:
addAttributeNodeaddAttributeNodeaddKeySubGraphaddKeySubGraphaddKeySubGraphaddKeySubGraphaddPluralSubgraphaddSubGraphaddSubGraphaddSubGraphaddSubGraphfindAttributeNodefindAttributeNodegetAttributeNodeListgetGraphAttributeNodesgetGraphedTypemakeCopymakeRootGraphmakeSubGraph

Method Detail

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

Implements jakarta.persistence.Subgraph.addAttributeNodes.

Doc from jakarta.persistence.Subgraph.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, ?>... attribute)

Implements jakarta.persistence.Subgraph.addAttributeNodes.

Doc from jakarta.persistence.Subgraph.addAttributeNodes.

Add one or more attribute nodes to the entity graph.

Parameters
attribute:Attribute<J, ?>[]

attribute

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

Implements jakarta.persistence.Subgraph.addKeySubgraph.

Doc from jakarta.persistence.Subgraph.addKeySubgraph.

Add a node to the graph that corresponds to a map key that is a managed type. This allows for construction of multinode 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.Subgraph.addKeySubgraph.

Doc from jakarta.persistence.Subgraph.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
attribute:Attribute<J, X>

attribute

type:Class<? extends X>

entity subclass

Returns:SubGraph<? extends X>

subgraph for the attribute

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

Implements jakarta.persistence.Subgraph.addKeySubgraph.

Doc from jakarta.persistence.Subgraph.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.Subgraph.addKeySubgraph.

Doc from jakarta.persistence.Subgraph.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
name:String

name of the attribute

type:Class<X>

entity subclass

Returns:SubGraph<X>

subgraph for the attribute

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

Implements jakarta.persistence.Subgraph.addSubgraph.

Doc from jakarta.persistence.Subgraph.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.Subgraph.addSubgraph.

Doc from jakarta.persistence.Subgraph.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.Subgraph.addSubgraph.

Doc from jakarta.persistence.Subgraph.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.Subgraph.addSubgraph.

Doc from jakarta.persistence.Subgraph.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.Subgraph.getAttributeNodes.

Doc from jakarta.persistence.Subgraph.getAttributeNodes.

Return the attribute nodes corresponding to the attributes of this managed type that are included in the subgraph.

Returns:List<AttributeNode<?>>

list of attribute nodes included in the subgraph or empty List if none have been defined

Annotations
@Override
@SuppressWarnings:unchecked, rawtypes
getClassTypeback to summary
public default Class<J> getClassType()

Implements jakarta.persistence.Subgraph.getClassType.

Doc from jakarta.persistence.Subgraph.getClassType.

Return the type for which this subgraph was defined.

Returns:Class<J>

managed type referenced by the subgraph

Annotations
@Override