Annotation Interface Fetch


@Target({METHOD,FIELD}) @Retention(RUNTIME) @Remove public @interface Fetch
Specifies the default fetching method for the annotated association.

When this annotation is not explicitly specified, then:

The default fetching method specified by this annotation may be overridden in a given fetch profile.

Note that join fetching is incompatible with lazy fetching, and so @Fetch(JOIN) implies fetch=EAGER, overriding any explicitly-specified fetch=LAZY setting.

See Also:
API Note:
Since FetchMode is deprecated, and since its name collides with Fetch, this annotation will eventually be deprecated and removed.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The method that should be used to fetch the association.
  • Element Details

    • value

      FetchMode value
      The method that should be used to fetch the association.