Top Description Methods
org.hibernate.graph

public Interface Graph<J>

extends GraphNode<J>
Known Direct Subinterfaces
org.hibernate.graph.RootGraph, org.hibernate.graph.SubGraph, org.hibernate.graph.spi.GraphImplementor
Annotations
@SuppressWarnings:unused, UnusedReturnValue
Imports
java.util.List, javax.persistence.metamodel.Attribute, .ManagedType

A container for AttributeNodes. Acts as a "bridge" between JPA's javax.persistence.EntityGraph and javax.persistence.Subgraph
Authors
Strong Liu, Steve Ebersole, Andrea Boriero

Method Summary

Modifier and TypeMethod and Description
public <AJ> AttributeNode<AJ>
addAttributeNode(String attributeName)

Add an AttributeNode (with no associated SubGraphNodes) to this container by attribute name

public <AJ> AttributeNode<AJ>
addAttributeNode(Attribute<? extends J, AJ> attribute)

Add an AttributeNode (with no associated SubGraphNode) to this container by Attribute reference

public <AJ> SubGraph<AJ>
addKeySubGraph(String attributeName)

public <AJ> SubGraph<AJ>
addKeySubGraph(String attributeName, Class<AJ> type)

public <AJ> SubGraph<AJ>
addKeySubGraph(Attribute<? extends J, AJ> attribute)

public <AJ> SubGraph<? extends AJ>
addKeySubGraph(Attribute<? extends J, AJ> attribute, Class<? extends AJ> type)

public <AJ> SubGraph<AJ>
addSubGraph(String attributeName)

Create a (mutable) SubGraphNode associated with the named AttributeNode.

public <AJ> SubGraph<AJ>
addSubGraph(String attributeName, Class<AJ> type)

public <AJ> SubGraph<AJ>
addSubGraph(Attribute<? extends J, AJ> attribute)

Create a (mutable) SubGraphNode associated with the AttributeNode for the given Attribute.

public <AJ> SubGraph<? extends AJ>
addSubGraph(Attribute<? extends J, AJ> attribute, Class<? extends AJ> type)

public <AJ> AttributeNode<AJ>
findAttributeNode(String attributeName)

Find an already existing AttributeNode by attributeName within this container

public <AJ> AttributeNode<AJ>
findAttributeNode(Attribute<? extends J, AJ> attribute)

Find an already existing AttributeNode by corresponding attribute reference, within this container

public List<AttributeNode<?>>
getAttributeNodeList()

Get a list of all existing AttributeNodes within this container

public List<AttributeNode<?>>
public ManagedType<J>
getGraphedType()

Graphs apply only to ManagedTypes.

public Graph<J>
public RootGraph<J>
makeRootGraph(String name, boolean mutable)

Create a named (if passed `name` != null) root Graph.

public SubGraph<J>
makeSubGraph(boolean mutable)

Create a (mutable/immutable) SubGraph based on this Graph

Inherited from org.hibernate.graph.GraphNode:
isMutable

Method Detail

addAttributeNodeback to summary
public <AJ> AttributeNode<AJ> addAttributeNode(String attributeName)

Add an AttributeNode (with no associated SubGraphNodes) to this container by attribute name

addAttributeNodeback to summary
public <AJ> AttributeNode<AJ> addAttributeNode(Attribute<? extends J, AJ> attribute)

Add an AttributeNode (with no associated SubGraphNode) to this container by Attribute reference

addKeySubGraphback to summary
public <AJ> SubGraph<AJ> addKeySubGraph(String attributeName) throws CannotContainSubGraphException
addKeySubGraphback to summary
public <AJ> SubGraph<AJ> addKeySubGraph(String attributeName, Class<AJ> type) throws CannotContainSubGraphException
addKeySubGraphback to summary
public <AJ> SubGraph<AJ> addKeySubGraph(Attribute<? extends J, AJ> attribute) throws CannotContainSubGraphException
addKeySubGraphback to summary
public <AJ> SubGraph<? extends AJ> addKeySubGraph(Attribute<? extends J, AJ> attribute, Class<? extends AJ> type) throws CannotContainSubGraphException
addSubGraphback to summary
public <AJ> SubGraph<AJ> addSubGraph(String attributeName) throws CannotContainSubGraphException

Create a (mutable) SubGraphNode associated with the named AttributeNode. The created SubGraphNode is returned

API Note

If no such AttributeNode exists yet, it is created.

addSubGraphback to summary
public <AJ> SubGraph<AJ> addSubGraph(String attributeName, Class<AJ> type) throws CannotContainSubGraphException
addSubGraphback to summary
public <AJ> SubGraph<AJ> addSubGraph(Attribute<? extends J, AJ> attribute) throws CannotContainSubGraphException

Create a (mutable) SubGraphNode associated with the AttributeNode for the given Attribute. The created SubGraphNode is returned

API Note

If no such AttributeNode exists yet, it is created.

addSubGraphback to summary
public <AJ> SubGraph<? extends AJ> addSubGraph(Attribute<? extends J, AJ> attribute, Class<? extends AJ> type) throws CannotContainSubGraphException
findAttributeNodeback to summary
public <AJ> AttributeNode<AJ> findAttributeNode(String attributeName)

Find an already existing AttributeNode by attributeName within this container

findAttributeNodeback to summary
public <AJ> AttributeNode<AJ> findAttributeNode(Attribute<? extends J, AJ> attribute)

Find an already existing AttributeNode by corresponding attribute reference, within this container

getAttributeNodeListback to summary
public List<AttributeNode<?>> getAttributeNodeList()

Get a list of all existing AttributeNodes within this container

getGraphAttributeNodesback to summary
public List<AttributeNode<?>> getGraphAttributeNodes()

Ultimately only needed for implementing javax.persistence.EntityGraph#getAttributeNodes() and javax.persistence.Subgraph#getAttributeNodes()

getGraphedTypeback to summary
public ManagedType<J> getGraphedType()

Graphs apply only to ManagedTypes. Returns the ManagedType being graphed here.

makeCopyback to summary
public Graph<J> makeCopy(boolean mutable)

Redeclares org.hibernate.graph.GraphNode.makeCopy.

Annotations
@Override
makeRootGraphback to summary
public RootGraph<J> makeRootGraph(String name, boolean mutable) throws CannotBecomeEntityGraphException

Create a named (if passed `name` != null) root Graph. The `mutable` parameter controls whether the created Graph is mutable.

Exceptions
CannotBecomeEntityGraphException:
For named attributes that are not entity valued
makeSubGraphback to summary
public SubGraph<J> makeSubGraph(boolean mutable)

Create a (mutable/immutable) SubGraph based on this Graph