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, javax.persistence.AttributeNode, .EntityGraph, .Subgraph, javax.persistence.metamodel.Attribute

Hibernate extension to the JPA EntityGraph contract.
Authors
Steve Ebersole, Andrea Boriero

Method Summary

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

Implements javax.persistence.EntityGraph.addAttributeNodes.

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

Implements javax.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 javax.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 javax.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 javax.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 javax.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 javax.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 javax.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 javax.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 javax.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 javax.persistence.EntityGraph.addSubgraph.

Add a node to the graph that corresponds to a managed type with inheritance.
public boolean
appliesTo(String entityName)

public boolean
appliesTo(Class<T> entityType)

public default List<AttributeNode<?>>
getAttributeNodes()

Implements javax.persistence.EntityGraph.getAttributeNodes.

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

Redeclares org.hibernate.graph.Graph.makeRootGraph.

Create a named (if passed `name` != null) root Graph.
public SubGraph<J>
makeSubGraph(boolean mutable)

Redeclares org.hibernate.graph.Graph.makeSubGraph.

Create a (mutable/immutable) SubGraph based on this Graph
Inherited from javax.persistence.EntityGraph:
getName
Inherited from org.hibernate.graph.Graph:
addAttributeNodeaddAttributeNodeaddKeySubGraphaddKeySubGraphaddKeySubGraphaddKeySubGraphaddSubGraphaddSubGraphaddSubGraphaddSubGraphfindAttributeNodefindAttributeNodegetAttributeNodeListgetGraphAttributeNodesgetGraphedTypemakeCopy

Method Detail

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

Implements javax.persistence.EntityGraph.addAttributeNodes.

Doc from javax.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 javax.persistence.EntityGraph.addAttributeNodes.

Doc from javax.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 javax.persistence.EntityGraph.addKeySubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addKeySubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addKeySubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addKeySubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addSubclassSubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addSubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addSubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addSubgraph.

Doc from javax.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 javax.persistence.EntityGraph.addSubgraph.

Doc from javax.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
appliesToback to summary
public boolean appliesTo(String entityName)
appliesToback to summary
public boolean appliesTo(Class<T> entityType)
getAttributeNodesback to summary
public default List<AttributeNode<?>> getAttributeNodes()

Implements javax.persistence.EntityGraph.getAttributeNodes.

Doc from javax.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
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 (if passed `name` != null) root Graph. The `mutable` parameter controls whether the created 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 (mutable/immutable) SubGraph based on this Graph