Enum FetchMode

  • All Implemented Interfaces:
    Serializable, Comparable<FetchMode>

    public enum FetchMode
    extends Enum<FetchMode>
    Enumerates the association fetching strategies available in Hibernate.

    Whereas the JPA FetchType enumeration provides a way to specify when an association should be fetched, this enumeration provides a way to express how it should be fetched.

    • Enum Constant Detail

      • SELECT

        public static final FetchMode SELECT
        The association or collection is fetched with a separate subsequent SQL select.
      • JOIN

        public static final FetchMode JOIN
        The association or collection is fetched using an outer join clause added to the initial SQL select.
      • SUBSELECT

        public static final FetchMode SUBSELECT
        For collections and many-valued associations only. After the initial SQL select, all associated collections are fetched together in a single subsequent 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