Package org.hibernate.annotations
Enum FetchMode
- java.lang.Object
-
- java.lang.Enum<FetchMode>
-
- org.hibernate.annotations.FetchMode
-
- All Implemented Interfaces:
Serializable
,Comparable<FetchMode>
public enum FetchMode extends Enum<FetchMode>
How the association should be fetched. Defines the "how", compared toFetchType
which defines "when"
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FetchMode
getHibernateFetchMode()
static FetchMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static FetchMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 nameNullPointerException
- if the argument is null
-
getHibernateFetchMode
public FetchMode getHibernateFetchMode()
-
-