Annotation Interface NamedAttributeNode


@Target({}) @Retention(RUNTIME) public @interface NamedAttributeNode
Declares an attribute node as a member element of a NamedEntityGraph.

A NamedAttributeNode is reified at runtime as an instance of AttributeNode.

Since:
2.1
See Also:
API note:
Alternatively, use Fetch to declare an attribute node by annotating a field of the graphed entity class.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    (Required) The name of the attribute that must be included in the graph.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    (Optional) If the attribute references a Map type, this element can be used to specify a subgraph for the Key in the case of an entity key type.
    (Optional) If the attribute references a managed type that has its own AttributeNodes, this element is used to refer to that NamedSubgraph definition.
  • Element Details

    • value

      String value
      (Required) The name of the attribute that must be included in the graph.
    • subgraph

      String subgraph
      (Optional) If the attribute references a managed type that has its own AttributeNodes, this element is used to refer to that NamedSubgraph definition.

      If the target type has inheritance, multiple subgraphs can be specified. These additional subgraphs are intended to add subclass-specific attributes. Superclass subgraph entries are merged into subclass subgraphs.

      The value of this element is the name of the subgraph as specified by the name element of the a NamedSubgraph annotation. That is, it is not the name of an entity graph, but the name of a named subgraph declared within the containing NamedEntityGraph annotation. If multiple subgraphs are specified due to inheritance, they are referenced by this name.

      Default:
      ""
    • keySubgraph

      String keySubgraph
      (Optional) If the attribute references a Map type, this element can be used to specify a subgraph for the Key in the case of an entity key type. A keySubgraph can not be specified without the Map attribute also being specified.

      If the target type has inheritance, multiple subgraphs can be specified. These additional subgraphs are intended to add subclass-specific attributes. Superclass subgraph entries are merged into subclass subgraphs.

      The value of this element is the name of the key subgraph as specified by the name element of the corresponding NamedSubgraph element. If multiple key subgraphs are specified due to inheritance, they are referenced by this name.

      Default:
      ""