Enum FetchMode

  • All Implemented Interfaces:
    Serializable, Comparable<FetchMode>

    public enum FetchMode
    extends Enum<FetchMode>
    Fetch options on associations. Defines more of the "how" of fetching, whereas JPA FetchType focuses on the "when".
    • Enum Constant Detail

      • SELECT

        public static final FetchMode SELECT
        Use a secondary select for each individual entity, collection, or join load.
      • JOIN

        public static final FetchMode JOIN
        Use an outer join to load the related entities, collections or joins.
      • SUBSELECT

        public static final FetchMode SUBSELECT
        Available for collections only.  When accessing a non-initialized collection, this fetch mode will trigger loading all elements of all collections of the same role for all owners associated with the persistence context using a single secondary select.
    • Method Detail

      • values

        public static FetchMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (FetchMode c : FetchMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static FetchMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null