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 and Description |
---|
JOIN
Use an outer join to load the related entities, collections or joins.
|
SELECT
Use a secondary select for each individual entity, collection, or join load.
|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final FetchMode SELECT
Use a secondary select for each individual entity, collection, or join load.
public static final FetchMode JOIN
Use an outer join to load the related entities, collections or joins.
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.
public static FetchMode[] values()
for (FetchMode c : FetchMode.values()) System.out.println(c);
public static FetchMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.