Annotation Interface NamedSubgraph


@Target({}) @Retention(RUNTIME) public @interface NamedSubgraph
Declares a subgraph as a member element of a NamedEntityGraph. The NamedSubgraph is only referenceable within its containing @NamedEntityGraph annotation and cannot be referenced independently.

A NamedSubgraph is referenced by name() from the subgraph element of a NamedAttributeNode annotation within the parent NamedEntityGraph.

A NamedSubgraph is reified at runtime as an instance of Subgraph.

Since:
2.1
See Also:
API note:
Alternatively, use NamedEntityGraph to declare the subgraph, and use Fetch to reference the subgraph by annotating a field of the graphed entity class.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    (Required) The list of the attributes of the class that must be included.
    (Required) The name of the subgraph as referenced from a NamedAttributeNode element.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    (Optional) The type represented by this subgraph.
  • Element Details

    • name

      String name
      (Required) The name of the subgraph as referenced from a NamedAttributeNode element. Subgraph names are scoped to the containing NamedEntityGraph, and must be unique within that graph.
    • type

      Class<?> type
      (Optional) The type represented by this subgraph. The element must be specified when this subgraph is extending a definition on behalf of a subclass.
      Default:
      void.class
    • attributeNodes

      NamedAttributeNode[] attributeNodes
      (Required) The list of the attributes of the class that must be included. If the named subgraph corresponds to a subclass of the class referenced by the corresponding attribute node, then only subclass-specific attributes are listed.