Jakarta Persistence (JPA) Interface
jakarta.persistence.Graph<T>
Declares operations common to
EntityGraph<T> and Subgraph<T>. - See Also:
- Since:
- Jakarta Persistence (JPA) 3.2
Public Instance Methods
- Parameters:
attributeName- name of the attribute
- Returns:
- the attribute node.
- Throws:
- if the EntityGraph has been statically defined.IllegalStateException- if the attribute is not an attribute of this entity..IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 3.2
- Parameters:
attribute- attribute
- Returns:
- the attribute node.
- Throws:
- if the EntityGraph has been statically defined.IllegalStateException
- Since:
- Jakarta Persistence (JPA) 3.2
If there is already an existing node for one of the given attribute names, that particular argument is ignored and has no effect.
- Parameters:
attributeName- name of the attribute
- Throws:
- if the EntityGraph has been statically defined.IllegalStateException- if the attribute is not an attribute of this managed type..IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
If there is already an existing node for one of the given attributes, that particular argument is ignored and has no effect.
- Parameters:
attribute- attribute
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attribute- attribute
- Returns:
- subgraph for the element attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not an entity.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 3.2
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attributeName- name of the attribute
- Returns:
- subgraph for the element attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attributeName- name of the attributetype- entity subclass
- Returns:
- subgraph for the element attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attribute- attribute
- Returns:
- subgraph for the key attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type entity.IllegalArgumentException
- Deprecated:
- use
addMapKeySubgraph
- Since:
- Jakarta Persistence (JPA) 1.0
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- attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type entity.IllegalArgumentException
- Deprecated:
- use
addTreatedMapKeySubgraph
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attributeName- name of the attribute
- Returns:
- subgraph for the key attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
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 attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attribute- attribute
- Returns:
- subgraph for the key attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type entity.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attribute- attribute
- Returns:
- subgraph for the attribute.
- Throws:
- if the EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
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- attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Deprecated:
- use
addTreatedSubgraph
- Since:
- Jakarta Persistence (JPA) 1.0
This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attributeName- name of the attribute
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
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 attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Subgraph<E> addTreatedElementSubgraph(PluralAttribute<? super T,?,? super E> attribute, Class<E> type)This allows for construction of multi-node entity graphs that include related managed types.
- Parameters:
attribute- attribute
- Returns:
- subgraph for the element attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not an entity.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 3.2
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- attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if this EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type entity.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
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- attributetype- entity subclass
- Returns:
- subgraph for the attribute.
- Throws:
- if the EntityGraph has been statically defined.IllegalStateException- if the attribute's target type is not a managed type.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 3.2
- Parameters:
attributeName- name of the attribute
- Returns:
- the attribute node.
- Throws:
- if the attribute is not an attribute of this entity..IllegalArgumentException- if there is no existing node for the attribute.NoSuchElementException
- Since:
- Jakarta Persistence (JPA) 3.2
- Parameters:
attribute- attribute
- Returns:
- the attribute node.
- Throws:
- if there is no existing node for the attribute.NoSuchElementException
- Since:
- Jakarta Persistence (JPA) 3.2
- Returns:
- list of attribute nodes included in the graph or an empty list if none have been defined.
- Since:
- Jakarta Persistence (JPA) 1.0
- Parameters:
attributeName- name of the attribute
- Returns:
- true if there is an existing attribute node.
- Throws:
- if the attribute is not an attribute of this entity..IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 3.2
- Parameters:
attribute- attribute
- Returns:
- true if there is an existing attribute node.
- Since:
- Jakarta Persistence (JPA) 3.2
When this graph is interpreted as a load graph, this operation suppresses inclusion of an attribute mapped for eager fetching. The effect of this call may be overridden by subsequent invocations of
addAttributeNode or addSubgraph. If there is no existing node for the given attribute name, this operation has no effect.- Parameters:
attributeName- name of the attribute
- Since:
- Jakarta Persistence (JPA) 3.2
When this graph is interpreted as a load graph, this operation suppresses inclusion of an attribute mapped for eager fetching. The effect of this call may be overridden by subsequent invocations of
addAttributeNode or addSubgraph. If there is no existing node for the given attribute, this operation has no effect.- Parameters:
attribute- attribute
- Since:
- Jakarta Persistence (JPA) 3.2
When this graph is interpreted as a load graph, this operation suppresses inclusion of attributes mapped for eager fetching. The effect of this call may be overridden by subsequent invocations of
addAttributeNode or addSubgraph.- Since:
- Jakarta Persistence (JPA) 3.2