JPA Interface

Subgraph

Type Parameters:
<T> - The type of the attribute.

This type represents a subgraph for an attribute node that corresponds to a Managed Type. Using this class, an entity subgraph can be embedded within an EntityGraph.
See Also:
EntityGraph
AttributeNode
NamedSubgraph
Since:
JPA 2.1

Public Methods

void addAttributeNodes(Attribute<T,?>... attribute)
Add one or more attribute nodes to the entity graph.
Parameters:
attribute - attribute
Throws:
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
void addAttributeNodes(String... attributeName)
Add one or more attribute nodes to the entity graph.
Parameters:
attributeName - name of the attribute
Throws:
IllegalArgumentException - if the attribute is not an attribute of this managed type.
IllegalStateException - if the EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addKeySubgraph(Attribute<T,X> attribute)
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
Return:
subgraph for the key attribute
Throws:
IllegalArgumentException - if the attribute's target type is not a managed type entity
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<?extendsX> addKeySubgraph(Attribute<T,X> attribute, Class<?extendsX> type)
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
type - entity subclass
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute's target type is not a managed type entity
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addKeySubgraph(String attributeName)
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:
attributeName - name of the attribute
Return:
subgraph for the key attribute
Throws:
IllegalArgumentException - if the attribute is not an attribute of this entity.
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addKeySubgraph(String attributeName, Class<X> type)
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:
attributeName - name of the attribute
type - entity subclass
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute is not an attribute of this entity.
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addSubgraph(Attribute<T,X> attribute)
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
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if the EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<?extendsX> addSubgraph(Attribute<T,X> attribute, Class<?extendsX> type)
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
type - entity subclass
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addSubgraph(String attributeName)
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:
attributeName - name of the attribute
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute is not an attribute of this managed type.
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Subgraph<X> addSubgraph(String attributeName, Class<X> type)
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:
attributeName - name of the attribute
type - entity subclass
Return:
subgraph for the attribute
Throws:
IllegalArgumentException - if the attribute is not an attribute of this managed type.
IllegalArgumentException - if the attribute's target type is not a managed type
IllegalStateException - if this EntityGraph has been statically defined
Since:
JPA 2.1
Return the attribute nodes corresponding to the attributes of this managed type that are included in the subgraph.
Return:
list of attribute nodes included in the subgraph or empty List if none have been defined
Since:
JPA 2.1
Class<T> getClassType()
Return the type for which this subgraph was defined.
Return:
managed type referenced by the subgraph
Since:
JPA 2.1