Jakarta Persistence (JPA) Method

Subgraph<Y> addTreatedSubgraph(
  Attribute<? super T,? super Y> attribute,
  Class<Y> 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
Returns:
subgraph for the attribute.
Throws:
IllegalStateException - if the EntityGraph has been statically defined.
IllegalArgumentException - if the attribute's target type is not a managed type.
Since:
Jakarta Persistence (JPA) 3.2